ClientIpFilter implements ClientFilter { private static boolean isAllowed(InetAddress client, AddressResolver addressResolver, String left, String right) { InetAddress leftAddress = addressResolver.resolve(left); InetAddress rightAddress = addressResolver.resolve(right); if (leftAddress == null || rightAddress == null) { return false; } return isAddressInRange(client, leftAddress, rightAddress); } ClientIpFilter(String[] filters);   ClientIpFilter(String[] filters, AddressResolver addressResolver); @Override boolean isAllowed(SocketAddress address);  }
@Test public void test() throws Exception { assertEquals(match, new ClientIpFilter(parseFilters()).isAllowed(createAddress())); }