### Question:
BCDInterpreter implements Interpreter { public String uninterpret(byte[] rawData, int offset, int length) { return ISOUtil.bcd2str (rawData, offset, length, leftPadded); } private  BCDInterpreter(boolean leftPadded, boolean fPadded); void interpret(String data, byte[] b, int offset); String uninterpret(byte[] rawData, int offset, int length); int getPackedLength(int nDataUnits); static final BCDInterpreter LEFT_PADDED; static final BCDInterpreter RIGHT_PADDED; static final BCDInterpreter RIGHT_PADDED_F; static final BCDInterpreter LEFT_PADDED_F; }### Answer:
@Test public void testUninterpret() throws Throwable { byte[] rawData = new byte[3]; String result = BCDInterpreter.LEFT_PADDED.uninterpret(rawData, 0, 1); assertEquals("0", result, "result"); }
@Test public void testUninterpretThrowsArrayIndexOutOfBoundsException() throws Throwable { assertThrows(ArrayIndexOutOfBoundsException.class, () -> { byte[] rawData = new byte[3]; BCDInterpreter.RIGHT_PADDED_F.uninterpret(rawData, 100, 1000); }); }
@Test public void testUninterpretThrowsNegativeArraySizeException() throws Throwable { assertThrows(NegativeArraySizeException.class, () -> { byte[] rawData = new byte[0]; BCDInterpreter.LEFT_PADDED.uninterpret(rawData, 100, -1); }); }
@Test public void testUninterpretThrowsNullPointerException() throws Throwable { assertThrows(NullPointerException.class, () -> { BCDInterpreter.LEFT_PADDED.uninterpret(null, 100, 1000); }); }