public Optional<Node> node(String listenerName) {
        Endpoint endpoint = listeners().get(listenerName);
        if (endpoint == null) {
            return Optional.empty();
        }
        return Optional.of(new Node(id, endpoint.host(), endpoint.port(), null));
    }
@Test
    public void testToNode() {
        assertEquals(Optional.empty(), REGISTRATIONS.get(0).node("NONEXISTENT"));
        assertEquals(Optional.of(new Node(0, "localhost", 9107, null)),
            REGISTRATIONS.get(0).node("PLAINTEXT"));
        assertEquals(Optional.of(new Node(0, "localhost", 9207, null)),
            REGISTRATIONS.get(0).node("SSL"));
    }