@Test
    void builtWithTwoLocalPorts() {
        final Collection<ServerPort> ports = serverBuiltWithTwoLocalPorts.server().activePorts().values();

        // Each `localPort(0)` must bound to both IPv4 and IPv6 loopback addresses.
        assertThat(ports).hasSize(4);

        // Must be loopback addresses and belong to a port group.
        ports.forEach(p -> {
            assertThat(p.localAddress().getAddress().isLoopbackAddress()).isTrue();
            assertThat(p.portGroup()).isNotZero();
        });

        // Each `localPort(0)` must bound at the same port number.
        assertThat(ports.stream().mapToInt(p -> p.localAddress().getPort()).distinct()).hasSize(2);

        // The ports created by each `localPort(0)` must belong to the same port group.
        assertThat(ports.stream().mapToLong(ServerPort::portGroup).distinct()).hasSize(2);
    }
Similar to {@link #builtWithoutLocalPort()} but we bind twice this time.
core/src/test/java/com/linecorp/armeria/server/ServerEphemeralLocalPortTest.java