### Question:
PostChannel extends BaseChannel { public void setHeader (String header) { super.setHeader ( ISOUtil.hex2byte (header.getBytes(), 0, header.length() / 2) ); } PostChannel();  PostChannel(String host, int port, ISOPackager p);  PostChannel(ISOPackager p);  PostChannel(ISOPackager p, ServerSocket serverSocket); void setHeader(String header);  }### Answer:
@Test public void testSetHeader() throws Throwable { PostChannel postChannel = new PostChannel(); postChannel.setHeader("testPostChannelHeader"); assertEquals(10, postChannel.getHeader().length, "postChannel.getHeader().length"); }
@Test public void testSetHeaderThrowsNullPointerException() throws Throwable { PostChannel postChannel = new PostChannel(); try { postChannel.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(postChannel.getHeader(), "postChannel.getHeader()"); } }