### Question:
PureJavaCrc32C implements Checksum { public static int mask(int crc) { return ((crc >>> 15) | (crc << 17)) + MASK_DELTA; } PureJavaCrc32C(); static int mask(int crc); static int unmask(int maskedCrc); int getMaskedValue(); int getIntValue(); @Override long getValue(); @Override final void reset(); @Override void update(byte[] b, int off, int len); @Override void update(int b);  }### Answer:
@Test public void testMask() throws UnsupportedEncodingException { PureJavaCrc32C crc = new PureJavaCrc32C(); crc.update("foo".getBytes(US_ASCII), 0, 3); assertEquals(crc.getMaskedValue(), mask(crc.getIntValue())); assertFalse(crc.getIntValue() == crc.getMaskedValue(), "crc should not match masked crc"); assertFalse( crc.getIntValue() == mask(crc.getMaskedValue()), "crc should not match double masked crc" ); assertEquals(crc.getIntValue(), unmask(crc.getMaskedValue())); assertEquals(crc.getIntValue(), unmask(unmask(mask(crc.getMaskedValue())))); }
@Test public void testMask() throws UnsupportedEncodingException { PureJavaCrc32C crc = new PureJavaCrc32C(); crc.update("foo".getBytes(US_ASCII), 0, 3); assertEquals(crc.getMaskedValue(), mask(crc.getIntValue())); assertFalse(crc.getIntValue() == crc.getMaskedValue(), "crc should not match masked crc"); assertFalse(crc.getIntValue() == mask(crc.getMaskedValue()), "crc should not match double masked crc"); assertEquals(crc.getIntValue(), unmask(crc.getMaskedValue())); assertEquals(crc.getIntValue(), unmask(unmask(mask(crc.getMaskedValue())))); }