CRC16 implements Checksum { public CRC16() { } CRC16(); @Override void update(int b); @Override void update(byte[] bytes, int offset, int length); @Override long getValue(); @Override void reset();  }
@Test public void testCRC16() { assertEquals(0xC6EB, computeCRC16("iV6jP5Xr0z")); assertEquals(0x2762, computeCRC16("dD5HnVp68n")); assertEquals(0x4FE7, computeCRC16("Fuu5G0DUJR")); assertEquals(0x337B, computeCRC16("iPeHJFjSCh")); assertEquals(0xD8CC, computeCRC16("vBS8tFjAOx")); assertEquals(0xE597, computeCRC16("iJA6cuvi4q")); assertEquals(0xE53B, computeCRC16("MeIWdZggy0")); assertEquals(0x843D, computeCRC16("The quick brown fox jumps over the lazy dog.")); assertEquals(0xA8E2, computeCRC16("Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod " + "tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, " + "quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo " + "consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse " + "cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat " + "non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.")); }