### Question:
CRC16 { public short crc(int crc, byte data) { byte in = reverseInput ? reverseByte(data) : data; short out = (short) (table[((crc >> 8) ^ in) & 0xFF] ^ (crc << 8)); return out; } private  CRC16(int polynomial,int initial, boolean reverseInput, boolean reverseOutput, int xorOutput); short crc(int crc, byte data); short crc(byte[] data); short crc(byte[] data,int offset, int length); static final CRC16 ARC; static final CRC16 AUG; static final CRC16 BUYPASS; static final CRC16 CCITT; static final CRC16 CDMA2000; static final CRC16 DDS110; static final CRC16 DECT_R; static final CRC16 DECT_X; static final CRC16 DNP; static final CRC16 EN_13757; static final CRC16 GENIBUS; static final CRC16 MAXIM; static final CRC16 MCRF4XX; static final CRC16 RIELLO; static final CRC16 T10_DIF; static final CRC16 TELEDISK; static final CRC16 TMS37157; static final CRC16 USB; static final CRC16 A; static final CRC16 MODBUS; static final CRC16 X25; static final CRC16 XMODEM; static final CRC16 KERMIT; }### Answer:
@Test public void testHubFromMac() { String str = "00112233445566778899AABBCCDDEEFF"; byte[] bytes = DatatypeConverter.parseHexBinary(str); assertEquals((short) 0x27A9, CRC16.ARC.crc(bytes)); assertEquals((short) 0x57E3, CRC16.AUG.crc(bytes)); assertEquals((short) 0x0B62, CRC16.BUYPASS.crc(bytes)); assertEquals((short) 0x7842, CRC16.CCITT.crc(bytes)); assertEquals((short) 0x9F0B, CRC16.CDMA2000.crc(bytes)); assertEquals((short) 0x8545, CRC16.DDS110.crc(bytes)); assertEquals((short) 0xDFE2, CRC16.DECT_R.crc(bytes)); assertEquals((short) 0xDFE3, CRC16.DECT_X.crc(bytes)); assertEquals((short) 0xF289, CRC16.DNP.crc(bytes)); assertEquals((short) 0xAF18, CRC16.EN_13757.crc(bytes)); assertEquals((short) 0x87BD, CRC16.GENIBUS.crc(bytes)); assertEquals((short) 0xD856, CRC16.MAXIM.crc(bytes)); assertEquals((short) 0x70AD, CRC16.MCRF4XX.crc(bytes)); assertEquals((short) 0x198A, CRC16.RIELLO.crc(bytes)); assertEquals((short) 0xB1B2, CRC16.T10_DIF.crc(bytes)); assertEquals((short) 0x70BC, CRC16.TELEDISK.crc(bytes)); assertEquals((short) 0x348C, CRC16.TMS37157.crc(bytes)); assertEquals((short) 0x28E8, CRC16.USB.crc(bytes)); assertEquals((short) 0x69CC, CRC16.A.crc(bytes)); assertEquals((short) 0xD717, CRC16.MODBUS.crc(bytes)); assertEquals((short) 0x8F52, CRC16.X25.crc(bytes)); assertEquals((short) 0x1248, CRC16.XMODEM.crc(bytes)); assertEquals((short) 0x20FB, CRC16.KERMIT.crc(bytes)); }