@SuppressWarnings("deprecation") @Test public void testPackThrowsNullPointerException() throws Throwable { ObjectOutput out = new ObjectOutputStream(new ByteArrayOutputStream()); try { new IF_ECHAR(100, "testISOFieldPackagerDescription").pack(new ISOField(), out); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"String.length()\" because \"str\" is null", ex.getMessage(), "ex.getMessage()"); } } }
public abstract byte[] pack (ISOComponent c) throws ISOException;
ISOFieldPackager { public abstract byte[] pack (ISOComponent c) throws ISOException; }
ISOFieldPackager { public abstract byte[] pack (ISOComponent c) throws ISOException; ISOFieldPackager();  ISOFieldPackager(int len, String description); }
ISOFieldPackager { public abstract byte[] pack (ISOComponent c) throws ISOException; ISOFieldPackager();  ISOFieldPackager(int len, String description); String getDescription(); void setDescription(String description); int getLength(); void setLength(int len); void setPad(boolean pad); void setTrim(boolean trim); abstract int getMaxPackedLength(); ISOComponent createComponent(int fieldNumber); abstract byte[] pack(ISOComponent c); abstract int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); void pack(ISOComponent c, ObjectOutput out); }
ISOFieldPackager { public abstract byte[] pack (ISOComponent c) throws ISOException; ISOFieldPackager();  ISOFieldPackager(int len, String description); String getDescription(); void setDescription(String description); int getLength(); void setLength(int len); void setPad(boolean pad); void setTrim(boolean trim); abstract int getMaxPackedLength(); ISOComponent createComponent(int fieldNumber); abstract byte[] pack(ISOComponent c); abstract int unpack(ISOComponent c, byte[] b, int offset); void unpack(ISOComponent c, InputStream in); void pack(ISOComponent c, ObjectOutput out);  }