static boolean isValidIpEntity(String ip) {
        if (ip == null) return true;
        try {
            InetAddress.getByName(ip);
            return true;
        } catch (UnknownHostException e) {
            return false;
        }
    }
@Test
    public void testIsValidIpEntityWithUnresolvableHostname() {
        // example.invalid will never be valid, as per RFC 2606.
        assertFalse(ClientQuotaControlManager.isValidIpEntity("example.invalid"));
    }