public static boolean isOnList(@Nonnull final Set<String> list, @Nonnull final String ipAddress) {
        Ipv4 remoteIpv4;
        try {
            remoteIpv4 = Ipv4.of(ipAddress);
        } catch (IllegalArgumentException e) {
            Log.trace("Address '{}' is not an IPv4 address.", ipAddress);
            remoteIpv4 = null;
        }
        Ipv6 remoteIpv6;
        try {
            remoteIpv6 = Ipv6.of(ipAddress);
        } catch (IllegalArgumentException e) {
            Log.trace("Address '{}' is not an IPv6 address.", ipAddress);
            remoteIpv6 = null;
        }

        if (remoteIpv4 == null && remoteIpv6 == null) {
            Log.warn("Unable to parse '{}' as an IPv4 or IPv6 address!", ipAddress);
        }

        for (final String item : list) {
            // Check if the remote address is an exact match on the list.
            if (item.equals(ipAddress)) {
                return true;
            }

            // Check if the remote address is a match for an address range on the list.
            if (remoteIpv4 != null) {
                Ipv4Range range;
                try {
                    range = Ipv4Range.parse(item);
                } catch (IllegalArgumentException e) {
                    Log.trace("List entry '{}' is not an IPv4 range.", item);
                    range = null;
                }
                if (range != null && range.contains(remoteIpv4)) {
                    return true;
                }
            }
            if (remoteIpv6 != null) {
                Ipv6Range range;
                try {
                    range = Ipv6Range.parse(item);
                } catch (IllegalArgumentException e) {
                    Log.trace("List entry '{}' is not an IPv6 range.", item);
                    range = null;
                }
                if (range != null && range.contains(remoteIpv6)) {
                    return true;
                }
            }
        }
        return false;
    }
@Test
    public void ipNotOnList() throws Exception {
        // Setup test fixture.
        final String input = "203.0.113.251";
        final Set<String> list = new HashSet<>();
        list.add("192.0.2.2");

        // Execute system under test.
        final boolean result = AuthCheckFilter.isOnList(list, input);

        // Verify result.
        assertFalse(result);
    }