### Question:
Base1_BITMAP126 extends ISOBitMapPackager { public int unpack (ISOComponent c, byte[] b, int offset) throws ISOException { int len; BitSet bmap = ISOUtil.byte2BitSet (b, offset, false); c.setValue(bmap); len = (len=bmap.size()) > 128 ? 128 : len; return len >> 3; } Base1_BITMAP126();  Base1_BITMAP126(int len, String description); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); int getMaxPackedLength();  }### Answer:
@Test public void testUnpackThrowsArrayIndexOutOfBoundsException() throws Throwable { byte[] b = new byte[0]; ISOComponent c = new ISOMsg(); try { new Base1_BITMAP126().unpack(c, b, 100); fail("Expected ArrayIndexOutOfBoundsException to be thrown"); } catch (ArrayIndexOutOfBoundsException ex) { if (isJavaVersionAtMost(JAVA_10)) { assertEquals("100", ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Index 100 out of bounds for length 0", ex.getMessage(), "ex.getMessage()"); } assertEquals(0, ((ISOMsg) c).getDirection(), "(ISOMsg) c.getDirection()"); } }
@Test public void testUnpackThrowsNullPointerException() throws Throwable { Base1_BITMAP126 base1_BITMAP126 = new Base1_BITMAP126(100, "testBase1_BITMAP126Description"); ISOComponent c = new ISOBinaryField(100); try { base1_BITMAP126.unpack(c, null, 100); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot load from byte/boolean array because \"b\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(((ISOBinaryField) c).getBytes(), "(ISOBinaryField) c.getBytes()"); } }