### Question:
AosFrameHeaderErrorCorr { public static DecoderResult decode(int gvcid, int signalingField, int errControl) throws ReedSolomonException { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF), (byte) ((errControl >> 12) & 0xF), (byte) ((errControl >> 8) & 0xF), (byte) ((errControl >> 4) & 0xF), (byte) ((errControl & 0xF)) }; int numc = rs.decode(data, null); int cvcid = (data[0] << 12) + (data[1] << 8) + (data[2] << 4) + data[3]; int csig = (data[4] << 4) + data[5]; return new DecoderResult(cvcid, csig, numc); }  static int encode(int gvcid, int signalingField); static DecoderResult decode(int gvcid, int signalingField, int errControl);  }### Answer:
@Test public void testDecode() throws ReedSolomonException { DecoderResult dr = AosFrameHeaderErrorCorr.decode(0x1234, 0x56, 0x94DC); checkEqual(0x1234, 0x56, dr); dr = AosFrameHeaderErrorCorr.decode(0x1234, 0x56, 0x9400); checkEqual(0x1234, 0x56, dr); dr = AosFrameHeaderErrorCorr.decode(0x1211, 0x56, 0x94DC); checkEqual(0x1234, 0x56, dr); dr = AosFrameHeaderErrorCorr.decode(0x1234, 0xAA, 0x94DC); checkEqual(0x1234, 0x56, dr); }
@Test(expected = ReedSolomonException.class) public void testUncorrecable() throws ReedSolomonException { DecoderResult dr = AosFrameHeaderErrorCorr.decode(0x1230, 0x00, 0x94DC); checkEqual(0x1234, 0x56, dr); }