### Question:
IFB_AMOUNT extends ISOFieldPackager { public byte[] pack (ISOComponent c) throws ISOException { String s = (String) c.getValue(); String amount = ISOUtil.zeropad(s.substring(1), getLength()-1); byte[] b = new byte[1 + (getLength() >> 1)]; b[0] = (byte) s.charAt(0); interpreter.interpret(amount, b, 1); return b; } IFB_AMOUNT();  IFB_AMOUNT(int len, String description, boolean pad); void setPad(boolean pad); byte[] pack(ISOComponent c); int unpack(ISOComponent c, byte[] b, int offset); int getMaxPackedLength();  }### Answer:
@Test public void testPack() throws Exception { ISOField field = new ISOField(12, "D123"); IFB_AMOUNT packager = new IFB_AMOUNT(6, "Should be D00123", true); TestUtils.assertEquals(new byte[]{68, 0x00, 0x01, 0x23}, packager.pack(field)); }
@Test public void testPackOddDigits() throws Exception { ISOField field = new ISOField(12, "D123"); IFB_AMOUNT packager = new IFB_AMOUNT(5, "Should be D0123", true); TestUtils.assertEquals(new byte[]{68, 0x01, 0x23}, packager.pack(field)); }