@Override
    public void close(String id) {
        // Note that there are no notifications for client-side disconnects

        removeSendsForNode(id, completedSends);
        removeSendsForNode(id, initiatedSends);
        ready.remove(id);

        for (int i = 0; i < this.connected.size(); i++) {
            if (this.connected.get(i).equals(id)) {
                this.connected.remove(i);
                break;
            }
        }
    }
A fake selector to use for testing
clients/src/test/java/org/apache/kafka/test/MockSelector.java