### Question:
NACChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { len += lenlen; serverOut.write (len >> 8); serverOut.write (len); } NACChannel();  NACChannel(String host, int port, ISOPackager p, byte[] TPDU);  NACChannel(ISOPackager p, byte[] TPDU);  NACChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); void setHeader(String header); void setConfiguration(Configuration cfg);  }### Answer:
@Test public void testSendMessageLengthThrowsNullPointerException() throws Throwable { byte[] TPDU = new byte[0]; NACChannel nACChannel = new NACChannel("testNACChannelHost", 100, new ISO93APackager(), TPDU); try { nACChannel.sendMessageLength(100); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.DataOutputStream.write(int)\" because \"this.serverOut\" is null", ex.getMessage(), "ex.getMessage()"); } } }