### Question:
Selector implements Selectable { @Override public void poll(long timeoutMs) throws IOException { poll(timeoutMs, null); } Selector(NetworkMetrics metrics, Time time, SSLFactory sslFactory, NetworkConfig networkConfig); @Override String connect(InetSocketAddress address, int sendBufferSize, int receiveBufferSize, PortType portType); String register(SocketChannel channel, PortType portType); @Override void disconnect(String connectionId); @Override void wakeup(); @Override void close(); @Override boolean isOpen(); void send(NetworkSend networkSend); @Override void poll(long timeoutMs); @Override void poll(long timeoutMs, List<NetworkSend> sends); boolean isChannelReady(String connectionId); @Override List<NetworkSend> completedSends(); @Override List<NetworkReceive> completedReceives(); @Override List<String> disconnected(); @Override List<String> connected(); @Override void close(String connectionId);  }### Answer:
@Test(expected = IllegalStateException.class) public void testCantSendWithInProgress() throws Exception { String connectionId = blockingConnect(); selector.poll(1000L, asList(createSend(connectionId, "test1"), createSend(connectionId, "test2"))); }
@Test(expected = IllegalStateException.class) public void testCantSendWithoutConnecting() throws Exception { selector.poll(1000L, asList(createSend("testCantSendWithoutConnecting_test", "test"))); }