### Question:
NCCChannel extends BaseChannel { protected int getMessageLength() throws IOException, ISOException { byte[] b = new byte[2]; serverIn.readFully(b,0,2); return Integer.parseInt ( ISOUtil.bcd2str (b, 0, 4, true) ); } NCCChannel();  NCCChannel(String host, int port, ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU);  NCCChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); void setHeader(String header); void setConfiguration(Configuration cfg);  }### Answer:
@Test public void testGetMessageLengthThrowsNullPointerException() throws Throwable { NCCChannel nCCChannel = new NCCChannel(); try { nCCChannel.getMessageLength(); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"java.io.DataInputStream.readFully(byte[], int, int)\" because \"this.serverIn\" is null", ex.getMessage(), "ex.getMessage()"); } } }