Base64 { public static byte[] decode(String data) { if (decoderMethod == null) throw new UnsupportedOperationException("Cannot find Base64 decoder."); try { return (byte[]) decoderMethod.invoke(decoderObject, data); } catch (Exception e) { throw new UnsupportedOperationException(e); } } private  Base64(); static byte[] decode(String data); static String encode(byte[] data);  }
@Test public void testDecode() throws Exception { String input = "SGVsbG8gV29ybGQh"; byte[] result = Base64.decode(input); assertEquals("Hello World!", new String(result)); }