### Question:
PADChannel extends BaseChannel { public void setHeader (String header) { super.setHeader ( ISOUtil.hex2byte (header.getBytes(), 0, header.length() / 2) ); } PADChannel();  PADChannel(String host, int port, ISOPackager p);  PADChannel(ISOPackager p);  PADChannel(ISOPackager p, ServerSocket serverSocket); @Override ISOMsg receive(); @Override void send(ISOMsg m); @Override void setConfiguration(Configuration cfg); void setHeader(String header);  }### Answer:
@Test public void testSetHeader() throws Throwable { PADChannel pADChannel = new PADChannel(); pADChannel.setHeader("testPADChannelHeader"); assertEquals(10, pADChannel.getHeader().length, "pADChannel.getHeader().length"); }
@Test public void testSetHeaderThrowsNullPointerException() throws Throwable { PADChannel pADChannel = new PADChannel(); try { pADChannel.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(pADChannel.getHeader(), "pADChannel.getHeader()"); } }