### Question:
Bits implements Cloneable { public byte[] asBytes() { return asBytes(0); } private  Bits( long[] longs, int numberOfBytes ); static Bits bits( int numberOfBytes ); static int requiredLongs( int numberOfBytes ); static Bits bitsFromLongs( long[] longs ); static Bits bitsFromBytes( byte[] bytes ); static Bits bitsFromBytes( byte[] bytes, int startIndex ); static Bits bitsFromBytes( byte[] bytes, int offset, int length ); static long rightOverflowMask( int steps ); @SuppressWarnings( "EI_EXPOSE_REP" ) long[] getLongs(); byte[] asBytes(); byte[] asBytes( int offsetBytes ); @Override String toString(); static void numberToString( StringBuilder builder, long value, int numberOfBytes ); static String numbersToBitString( byte[] values ); static String numbersToBitString( short[] values ); static String numbersToBitString( int[] values ); static String numbersToBitString( long[] values ); @Override Bits clone(); Bits put( byte value ); Bits put( byte value, int steps ); Bits put( short value ); Bits put( short value, int steps ); Bits put( int value ); Bits put( int value, int steps ); Bits put( long value ); Bits put( long value, int steps ); Bits put( byte[] bytes, int offset, int length ); boolean available(); byte getByte(); byte getByte( int steps ); short getShort(); short getShort( int steps ); int getInt(); int getInt( int steps ); long getUnsignedInt(); long getLong(); long getLong( int steps ); static boolean bitFlag( byte flags, byte flag ); static byte bitFlag( boolean value, byte flag ); static byte notFlag( byte flags, byte flag ); static byte bitFlags( byte... flags ); void clear( boolean zeroBits ); int longsInUse();  }### Answer:
@Test public void asBytes() { int numberOfBytes = 14; Bits bits = bits( numberOfBytes ); for ( byte i = 0; i < numberOfBytes; i++ ) { bits.put( i ); } byte[] bytes = bits.asBytes(); for ( byte i = 0; i < numberOfBytes; i++ ) { assertEquals( i, bytes[i] ); } }