### Question:
HeaderParser { protected static int int24parse(byte[] int24) { return int24[2] & 0xFF | (int24[1] & 0xFF) << 8 | (int24[0] & 0xFF) << 16; }  static CustomHeader parse(File map); static CustomHeader parse(byte[] map); static CustomHeader parse(ByteSource source); static int findEndOfHeader(ByteSource source);  }### Answer:
@Test public void testInt24parse() throws Exception { byte[] input = { (byte) 0x0f, (byte) 0x35, (byte) 0xa2 }; int expected = 996770; int actual = HeaderParser.int24parse(input); assertEquals(expected, actual); }
@Test public void testInt24roundtrip() throws Exception { int expected = 42 * 1337 + 0xF0000; byte[] int24 = CustomHeader.int24write(expected); int actual = HeaderParser.int24parse(int24); assertEquals(expected, actual); }