### Question:
X25Channel extends BaseChannel { public void setHeader (byte[] header) { this.header = header; } X25Channel();  X25Channel(String host, int port, ISOPackager p);  X25Channel(ISOPackager p);  X25Channel(ISOPackager p, ServerSocket serverSocket); void disconnect(); void setHeader(byte[] header); void setHeader(String header); byte[] getHeader();  }### Answer:
@Test public void testSetHeader() throws Throwable { X25Channel x25Channel = new X25Channel(new PostPackager()); x25Channel.setHeader("testX25ChannelHeader"); assertEquals(10, x25Channel.header.length, "x25Channel.header.length"); }
@Test public void testSetHeaderThrowsNullPointerException() throws Throwable { X25Channel x25Channel = new X25Channel("testX25ChannelHost", 100, new XMLPackager()); try { x25Channel.setHeader((String) null); fail("Expected NullPointerException to be thrown"); } catch (NullPointerException ex) { if (isJavaVersionAtMost(JAVA_14)) { assertNull(ex.getMessage(), "ex.getMessage()"); } else { assertEquals("Cannot invoke \"String.getBytes()\" because \"header\" is null", ex.getMessage(), "ex.getMessage()"); } assertNull(x25Channel.header, "x25Channel.header"); } }