@Override
    public String toString() {
        return "ControllerRegistration(id=" + id +
                ", incarnationId=" + incarnationId +
                ", zkMigrationReady=" + zkMigrationReady +
                ", listeners=[" +
                listeners.keySet().stream().sorted().
                        map(n -> listeners.get(n).toString()).
                        collect(Collectors.joining(", ")) +
                "], supportedFeatures={" +
                supportedFeatures.keySet().stream().sorted().
                        map(k -> k + ": " + supportedFeatures.get(k)).
                        collect(Collectors.joining(", ")) +
                "}" +
                ")";
    }
@Test
    public void testToString() {
        assertEquals("ControllerRegistration(id=1, " +
            "incarnationId=ubT_wuD6R3uopZ_lV76dQg, " +
            "zkMigrationReady=true, " +
            "listeners=[" +
            "Endpoint(listenerName='PLAINTEXT', securityProtocol=PLAINTEXT, host='localhost', port=9108), " +
            "Endpoint(listenerName='SSL', securityProtocol=SSL, host='localhost', port=9208)]" +
            ", supportedFeatures={metadata.version: 1-10})",
            REGISTRATIONS.get(1).toString());
    }