@Test
    public void testCloseOldestConnection() throws Exception {
        String id = "0";
        selector.connect(id, new InetSocketAddress("localhost", server.port), BUFFER_SIZE, BUFFER_SIZE);
        NetworkTestUtils.waitForChannelConnected(selector, id);
        time.sleep(CONNECTION_MAX_IDLE_MS + 1_000);
        selector.poll(0);

        assertTrue(selector.disconnected().containsKey(id), "The idle connection should have been closed");
        assertEquals(ChannelState.EXPIRED, selector.disconnected().get(id));
    }
Validate that we can send and receive a message larger than the receive and send buffer size
clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java