TcpMessageQueue implements IMessageQueue<String> { @Override public TcpMessageReceiver getReceiver() throws MessagingException { if (!receiver.isConnected()) { receiver.bind(); } return receiver; } TcpMessageQueue(String host); @Override TcpMessageReceiver getReceiver(); @Override IMessageSender<String> createSender(); @Override void terminate();  }
@Test(expected = IllegalArgumentException.class) public void testBadHostname() throws MessagingException { IMessageQueue<String> queue = new TcpMessageQueue("!@#$%^^&"); IMessageReceiver<String> receiver = queue.getReceiver(); }