public static boolean isAddressInAnyOf(final @Nonnull String address, final @Nonnull Set<String> addressesAndRanges)
    {
        if (isValidIpv4(address)) {
            return isAddressInAnyOf(Ipv4.of(address), addressesAndRanges);
        }
        if (isValidIpv6(address)) {
            return isAddressInAnyOf(Ipv6.of(address), addressesAndRanges);
        }
        throw new IllegalArgumentException("Unrecognized address type: " + address);
    }
Checks if the provided address is matched by any of the addresses or address ranges.

@param address The address to look up.
@param addressesAndRanges the values to compare the provided address with.
@return <tt>true</tt> if the address is found in the addresses or ranges, otherwise <tt>false</tt>.
xmppserver/src/main/java/org/jivesoftware/util/IpUtils.java