static DiscoveryResponse parseJsonResponse(JsonValue jsonValue, boolean tpcEnabled) throws IOException {
        List<JsonValue> response = jsonValue.asArray().values();

        Map<Address, Address> privateToPublic = new HashMap<>();
        List<Address> memberAddresses = new ArrayList<>(response.size());

        for (JsonValue value : response) {
            JsonObject object = value.asObject();
            String privateAddress = object.get(PRIVATE_ADDRESS_PROPERTY).asString();
            String publicAddress = object.get(PUBLIC_ADDRESS_PROPERTY).asString();

            Address publicAddr = createAddress(publicAddress, -1);
            // if it is not explicitly given, create the private address with public addresses port
            Address privateAddr = createAddress(privateAddress, publicAddr.getPort());

            privateToPublic.put(privateAddr, publicAddr);
            memberAddresses.add(privateAddr);

            JsonValue tpcPorts = object.get(TPC_PORTS_PROPERTY);
            if (!tpcEnabled || tpcPorts == null) {
                continue;
            }

            try {
                for (JsonValue tpcPort : tpcPorts.asArray()) {
                    parseTpcPortMapping(tpcPort.asObject(), publicAddr.getHost(), privateAddr.getHost(), privateToPublic);
                }
            } catch (Exception ignored) {
                EmptyStatement.ignore(ignored);
            }
        }

        return new DiscoveryResponse(privateToPublic, memberAddresses);
    }
@Test
    public void testJsonResponseParse_withTpc() throws IOException {
        JsonValue jsonResponse = Json.parse("""
                [
                  {
                    "private-address": "10.96.5.1:30000",
                    "public-address": "100.113.44.139:31115",
                    "tpc-ports": [
                      {
                        "private-port": 40000,
                        "public-port": 32115
                      }
                    ]
                  }
                ]""");
        HazelcastCloudDiscovery.DiscoveryResponse response = HazelcastCloudDiscovery.parseJsonResponse(jsonResponse, true);
        Map<Address, Address> privateToPublic = response.getPrivateToPublicAddresses();

        assertEquals(2, privateToPublic.size());
        assertEquals(new Address("100.113.44.139", 31115), privateToPublic.get(new Address("10.96.5.1", 30000)));
        assertEquals(new Address("100.113.44.139", 32115), privateToPublic.get(new Address("10.96.5.1", 40000)));

        List<Address> members = response.getPrivateMemberAddresses();

        assertEquals(1, members.size());
        assertContains(members, new Address("10.96.5.1", 30000));
    }