### Question:
RawChannel extends BaseChannel { protected void sendMessageLength(int len) throws IOException { serverOut.write (len >> 24); serverOut.write (len >> 16); serverOut.write (len >> 8); serverOut.write (len); } RawChannel();  RawChannel(String host, int port, ISOPackager p, byte[] header);  RawChannel(ISOPackager p, byte[] header);  RawChannel(ISOPackager p, byte[] header, ServerSocket serverSocket); void setHeader(String header);  }### Answer:
@Test public void testSendMessageLengthThrowsNullPointerException() throws Throwable { RawChannel rawChannel = new RawChannel(); try { rawChannel.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()"); } } }