### Question:
ISOField extends ISOComponent implements Cloneable, Externalizable { @Override public byte[] pack() throws ISOException { throw new ISOException ("Not available on Leaf"); } ISOField();  ISOField(int n);  ISOField(int n, String v); @Override byte[] pack(); @Override int unpack(byte[] b); @Override void unpack(InputStream in); @Override Object getKey(); @Override Object getValue(); @Override void setValue(Object obj); @Override byte[] getBytes(); @Override void dump(PrintStream p, String indent); @Override void setFieldNumber(int fieldNumber); @Override int getFieldNumber(); @Override void writeExternal(ObjectOutput out); @Override void readExternal(ObjectInput in);  }### Answer:
@Test public void testPackThrowsISOException() throws Throwable { try { new ISOField(100).pack(); fail("Expected ISOException to be thrown"); } catch (ISOException ex) { assertEquals("Not available on Leaf", ex.getMessage(), "ex.getMessage()"); assertNull(ex.nested, "ex.nested"); } }