### Question:
NACChannel extends BaseChannel { public void setHeader (String header) { super.setHeader (ISOUtil.str2bcd(header, false)); } NACChannel();  NACChannel(String host, int port, ISOPackager p, byte[] TPDU);  NACChannel(ISOPackager p, byte[] TPDU);  NACChannel(ISOPackager p, byte[] TPDU, ServerSocket serverSocket); void setHeader(String header); void setConfiguration(Configuration cfg);  }### Answer:
@Test public void testSetHeader() throws Throwable { NACChannel nACChannel = new NACChannel(); nACChannel.setHeader("testNACChannelHeader"); assertEquals(10, nACChannel.getHeader().length, "nACChannel.getHeader().length"); }
@Test public void testSetHeaderThrowsNullPointerException() throws Throwable { byte[] TPDU = new byte[0]; byte[] TPDU2 = new byte[1]; NACChannel nACChannel = new NACChannel(new ISO93APackager(), TPDU2, new ServerSocket()); new NACChannel(new ISO93BPackager(), TPDU).addFilter(new DelayFilter(), 100); try { nACChannel.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(TPDU2, nACChannel.getHeader(), "nACChannel.getHeader()"); } }