I should start by saying that I have looked at the solution after I couldn't figure out why this wasn't working. So it's not so much finding a solution that I need help with, just want to know why my beautifully simple solution does not pass. I have tested it with just about every string I can think of (I wrote it as a separate method so it would be easier to test that actually creating data for String[] args). The results match what the conditions say I should be getting. The logic here is that it starts with radix 2, and in counting up, if it successfully creates the BigInteger object without exception, then it returns that radix right away which terminates the rest of the method. If it completes the for loop without returning anything, this should only be possible if the string contains illegal characters and it then returns "invalid". I wrote it this way to see if it could be done without using the Pattern class and regex searches. Something is definitely funky with the validation on this one, as the only line capable of generating an exception is line 24, and that's in a try/catch block so it's covered.