### Question:
Base64 { public static String encodeBytes( byte[] source ) { String encoded = null; try { encoded = encodeBytes(source, 0, source.length, NO_OPTIONS); } catch (java.io.IOException ex) { assert false : ex.getMessage(); } assert encoded != null; return encoded; } private  Base64(); static String encode( java.io.InputStream source ); static String encode( java.io.InputStream source,
                                 int options ); static void encode( java.nio.ByteBuffer raw,
                               java.nio.ByteBuffer encoded ); static void encode( java.nio.ByteBuffer raw,
                               java.nio.CharBuffer encoded ); static String encodeObject( java.io.Serializable serializableObject ); static String encodeObject( java.io.Serializable serializableObject,
                                       int options ); static String encodeBytes( byte[] source ); static String encodeBytes( byte[] source,
                                      int options ); static String encodeBytes( byte[] source,
                                      int off,
                                      int len ); static String encodeBytes( byte[] source,
                                      int off,
                                      int len,
                                      int options ); static byte[] encodeBytesToBytes( byte[] source ); static byte[] encodeBytesToBytes( byte[] source,
                                             int off,
                                             int len,
                                             int options ); static byte[] decode( byte[] source ); static byte[] decode( byte[] source,
                                 int off,
                                 int len,
                                 int options ); static byte[] decode( String s ); static byte[] decode( String s,
                                 int options ); static Object decodeToObject( String encodedObject ); static Object decodeToObject( String encodedObject,
                                         int options,
                                         final ClassLoader loader ); static void encodeToFile( byte[] dataToEncode,
                                     String filename ); static void decodeToFile( String dataToDecode,
                                     String filename ); static byte[] decodeFromFile( String filename ); static String encodeFromFile( String filename ); static void encodeFileToFile( String infile,
                                         String outfile ); static void decodeFileToFile( String infile,
                                         String outfile ); final static int NO_OPTIONS; final static int ENCODE; final static int DECODE; final static int GZIP; final static int DONT_GUNZIP; final static int DO_BREAK_LINES; final static int URL_SAFE; final static int ORDERED; }### Answer:
@Test( expected = NullPointerException.class ) public void testEncodeNullByteArray() { Base64.encodeBytes(null); }
@Test public void testEncodeEmptyByteArray() { String result = Base64.encodeBytes(new byte[] {}); assertThat(result, is(notNullValue())); assertThat(result.length(), is(0)); }