Crc32 { public static long getCRC32Checksum(byte[] bytes) { Checksum checksum = new CRC32(); checksum.update(bytes, 0, bytes.length); return checksum.getValue(); }  static long getCRC32Checksum(byte[] bytes);  }
@Test public void testChecksum(){ byte[] data = "data".getBytes(); long checksum1 = Crc32.getCRC32Checksum(data); CRC32 crc32 = new CRC32(); crc32.update(data); long checksum2 = crc32.getValue(); Assert.assertEquals(checksum1, checksum2); }