### Question:
Utils { public static byte [] b64Decode(CharSequence encoded) { if(encoded.length() % 4 != 0) { throw new IllegalArgumentException("Invalid base64 input, must have a multiple of 4 characters"); } int resultLength = (encoded.length() / 4) * 3; if(encoded.charAt(encoded.length() - 1) == '=') { resultLength--; } if(encoded.charAt(encoded.length() - 2) == '=') { resultLength--; } byte [] decoded = new byte[resultLength]; for(int i=3,o=2; o<resultLength; i+=4,o+=3) { int i0 = reverseLookup(encoded.charAt(i - 3)); int i1 = reverseLookup(encoded.charAt(i - 2)); int i2 = reverseLookup(encoded.charAt(i - 1)); int i3 = reverseLookup(encoded.charAt(i)); decoded[o - 2] = (byte)( (i0 << 2) | (i1 >> 4) ); decoded[o - 1] = (byte)( ((i1 << 4) & 0xf0) | (i2 >> 2) ); decoded[o] = (byte)( ((i2 << 6) & 0xc0) | i3 ); } if(resultLength % 3 == 2) { int i0 = reverseLookup(encoded.charAt(encoded.length() - 4)); int i1 = reverseLookup(encoded.charAt(encoded.length() - 3)); int i2 = reverseLookup(encoded.charAt(encoded.length() - 2)); decoded[resultLength - 2] = (byte)( (i0 << 2) | (i1 >> 4) ); decoded[resultLength - 1] = (byte)( ((i1 << 4) & 0xf0) | (i2 >> 2) ); } if(resultLength % 3 == 1) { int i0 = reverseLookup(encoded.charAt(encoded.length() - 4)); int i1 = reverseLookup(encoded.charAt(encoded.length() - 3)); decoded[resultLength - 1] = (byte)( (i0 << 2) | (i1 >> 4) ); } return decoded; } private  Utils(); static String getNamespace(String name); static boolean isNamespaced(String name); static String namespace(String namespace, String name); static void assertNotNull(Object argument); static void assertNotNull(Object argument, Object message); static void assertNotEmpty(String value); static void assertNotEmpty(String value, Object message); static void assertNotEmpty(Map<?,?> map); static void assertNotEmpty(Map<?,?> map,  Object message); static void assertNotEmpty(Collection<?> collection); static void assertNotEmpty(Collection<?> collection,  Object message); static void assertTrue(boolean expression); static void assertTrue(boolean expression, Object message); static void assertFalse(boolean expression); static void assertFalse(boolean expression, Object message); static Map<K, V> unmodifiableCopy(Map<K, V> source); static final String serializeType(Type type); static final Type deserializeType(String type); static String b64Encode(byte[] binary); static byte [] b64Decode(CharSequence encoded); static final byte[] hash(String value); static final byte[] hash(InputStream is); static final String shortHash(InputStream is); @Deprecated static byte[] aesEncrypt(String secretStr, byte[] decrypted); @Deprecated static byte[] aesDecrypt(String secretStr, byte[] encrypted); @Deprecated static String aesEncrypt(String secretStr, String decrypted); @Deprecated static String aesDecrypt(String secretStr, String encrypted); static boolean setIf(String key, Object value, Map<String,Object> map); static Map<String, String> coerceToStringMap(Map<String, ?> value); static String coerceToString(Object value); static String randomTokenString(int length); static final Charset UTF_8; static final Object [] EMPTY_ARRAY; static final byte [] EMPTY_BYTE_ARRAY; }### Answer:
@Test public void testBase64Decode() { System.out.println(Arrays.toString(Utils.b64Decode("AQAAAAceYgIAAAAA"))); }