### Question:
Base64Util { public static String encode(byte[] bytes, boolean isChunked) { byte[] byte64 = Base64.encodeBase64(bytes, isChunked); String result = new String(byte64); String endChars; if (result.endsWith((endChars = CR_LF_UNIX)) || result.endsWith((endChars = CR_LF_WIN))) { result = result.substring(0, result.length() - endChars.length()); } return result; }  static String encode(byte[] bytes, boolean isChunked); static String decode(byte[] bytes);  }### Answer:
@Test public void testEncode() { Assert.assertEquals("", Base64Util.encode(new byte[0], true)); Assert.assertEquals("", Base64Util.encode(new byte[0], false)); Assert.assertEquals("AQID", Base64Util.encode(new byte[]{1, 2, 3}, true)); Assert.assertEquals("AQID", Base64Util.encode(new byte[]{1, 2, 3}, false)); }