class IPFilter implements Filter {

    public boolean accept(String ip) {
        if (whites.isEmpty() && blacks.isEmpty())
            return true;

        if (!whites.isEmpty()) {
            for (String w : whites) {
                if (simpleMatch(ip, w))
                    return true;
            }
            return false;
        }

        if (blacks.isEmpty())
            throw new IllegalStateException("cannot happen");

        for (String b : blacks) {
            if (simpleMatch(ip, b))
                return false;
        }

        return true;
    }

    public  IPFilter(String whiteList, String blackList);

}