Base32 { static int getCharIndex(char ch) { Integer result = characterIndexes.get(ch); if (result == null) throw new IllegalArgumentException("not a base32 character: " + ch); else return result; } private  Base32(); static String encodeBase32(long i, int length); static String encodeBase32(long i); static long decodeBase32(String hash);  }
@Test(expected = IllegalArgumentException.class) public void testGetCharIndexThrowsExceptionWhenNonBase32CharacterGiven() { Base32.getCharIndex('?'); }