### Question:
DataChecksum implements Checksum { public static DataChecksum newDataChecksum( int type, int bytesPerChecksum ) { if ( bytesPerChecksum <= 0 ) { return null; } switch ( type ) { case CHECKSUM_NULL : return new DataChecksum( CHECKSUM_NULL, new ChecksumNull(), CHECKSUM_NULL_SIZE, bytesPerChecksum ); case CHECKSUM_CRC32 : return new DataChecksum( CHECKSUM_CRC32, new PureJavaCrc32(), CHECKSUM_CRC32_SIZE, bytesPerChecksum ); case CHECKSUM_CRC32C: return new DataChecksum( CHECKSUM_CRC32C, new PureJavaCrc32C(), CHECKSUM_CRC32C_SIZE, bytesPerChecksum); default: return null; } } private  DataChecksum( int checksumType, Checksum checksum,
                        int sumSize, int chunkSize ); static DataChecksum newDataChecksum( int type, int bytesPerChecksum ); static DataChecksum newDataChecksum( byte bytes[], int offset ); static DataChecksum newDataChecksum( DataInputStream in ); void writeHeader( DataOutputStream out ); byte[] getHeader(); int writeValue( DataOutputStream out, boolean reset ); int writeValue( byte[] buf, int offset, boolean reset ); boolean compare( byte buf[], int offset ); int getChecksumType(); int getChecksumSize(); int getBytesPerChecksum(); int getNumBytesInSum(); static int getChecksumHeaderSize(); long getValue(); void reset(); void update( byte[] b, int off, int len ); void update( int b ); void verifyChunkedSums(ByteBuffer data, ByteBuffer checksums,
      String fileName, long basePos); void calculateChunkedSums(ByteBuffer data, ByteBuffer checksums); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static String getNameOfType(int checksumType); static int getTypeFromName(String checksumName); static final int HEADER_LEN; static final int CHECKSUM_NULL; static final int CHECKSUM_CRC32; static final int CHECKSUM_CRC32C; static final int CHECKSUM_DEFAULT; static final int CHECKSUM_MIXED; static final int SIZE_OF_INTEGER; }### Answer:
@Test public void testBulkOps() throws Exception { for (int type : CHECKSUM_TYPES) { System.err.println( "---- beginning tests with checksum type " + type + "----"); DataChecksum checksum = DataChecksum.newDataChecksum( type, BYTES_PER_CHUNK); for (boolean useDirect : new boolean[]{false, true}) { doBulkTest(checksum, 1023, useDirect); doBulkTest(checksum, 1024, useDirect); doBulkTest(checksum, 1025, useDirect); } } }