@Override
    public Address translate(Address address) throws Exception {
        if (address == null) {
            return null;
        }

        // if it is inside cloud, return private address otherwise we need to translate it.
        if (!usePublic) {
            return address;
        }

        Address publicAddress = privateToPublic.get(address);
        if (publicAddress != null) {
            return publicAddress;
        }

        privateToPublic = getAddresses.call();

        return privateToPublic.get(address);
    }
@Test
    public void testTranslate_whenNotFound_thenReturnNull() throws Exception {
        RemoteAddressProvider provider = new RemoteAddressProvider(() -> expectedAddresses, true);
        Address notAvailableAddress = new Address("127.0.0.3", 5701);
        Address actual = provider.translate(notAvailableAddress);

        assertNull(actual);
    }