### Question:
RawChannel extends BaseChannel { public void setHeader (String header) { super.setHeader (ISOUtil.str2bcd(header, false)); } 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 testSetHeader() throws Throwable { RawChannel rawChannel = new RawChannel(); rawChannel.setHeader("testRawChannelHeader"); assertEquals(10, rawChannel.getHeader().length, "rawChannel.getHeader().length"); }
@Test public void testSetHeaderThrowsNullPointerException() throws Throwable { byte[] header = new byte[0]; RawChannel rawChannel = new RawChannel(mock(VISA1Packager.class), header); try { rawChannel.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.length()\" because \"s\" is null", ex.getMessage(), "ex.getMessage()"); } assertSame(header, rawChannel.getHeader(), "rawChannel.getHeader()"); } }