Base64Utils { public static String encode(final byte[] raw) { if (null == raw || raw.length == 0) { return StringUtils.EMPTY_STRING; } return BaseEncoding.base64().encode(raw); }  static String encode(final byte[] raw); static byte[] decode(final String base64Encoded);  }
@Test public void testEncode() { assertEquals(ENCODED, Base64Utils.encode(DECODED)); assertEquals("", Base64Utils.encode(new byte[0])); assertEquals("", Base64Utils.encode(null)); }