}
@Test
public void testNewSocketThrowsIllegalArgumentException() throws Throwable {
byte[] TPDU = new byte[0];
BaseChannel hEXChannel = new HEXChannel("testBaseChannelHost", -1, new GenericPackager(), TPDU);
try {
hEXChannel.newSocket("test", -1);
fail("Expected IllegalArgumentException to be thrown");
} catch (IllegalArgumentException ex) {
assertEquals("ex.getMessage()", "port out of range:-1", ex.getMessage());
assertNull("(HEXChannel) hEXChannel.socketFactory", ((HEXChannel) hEXChannel).socketFactory);
}