@Test
    void hostnameKeyGeneration() throws Exception {
        final String expectedKey = "foo.com|80";
        assertThat(SessionProtocolNegotiationCache.key(
                Endpoint.of("foo.com"), SessionProtocol.H1C))
                .isEqualTo(expectedKey);
        assertThat(SessionProtocolNegotiationCache.key(
                Endpoint.of("foo.com", 80), SessionProtocol.H1C))
                .isEqualTo(expectedKey);
        assertThat(SessionProtocolNegotiationCache.key(
                Endpoint.of("foo.com").withIpAddr("127.0.0.1"), SessionProtocol.H1C))
                .isEqualTo(expectedKey);
        assertThat(SessionProtocolNegotiationCache.key(
                Endpoint.of("foo.com", 80).withIpAddr("127.0.0.1"), SessionProtocol.H1C))
                .isEqualTo(expectedKey);
        assertThat(SessionProtocolNegotiationCache.key(
                InetSocketAddress.createUnresolved("foo.com", 80)))
                .isEqualTo(expectedKey);
        assertThat(SessionProtocolNegotiationCache.key(
                new InetSocketAddress(InetAddress.getByAddress("foo.com",
                                                               new byte[] { 127, 0, 0, 1 }), 80)))
                .isEqualTo(expectedKey);
    }
Makes sure the cache keys created via different paths are the same.
core/src/test/java/com/linecorp/armeria/client/SessionProtocolNegotiationCacheTest.java