public boolean isConnected(String idString) {
        return connectionState(idString).state == ConnectionState.State.CONNECTED;
    }
A mock network client for use testing code
clients/src/test/java/org/apache/kafka/clients/MockClient.java