NetMatcher { @Override public String toString() { return networks.toString(); } NetMatcher(String[] nets, DNSService dnsServer);  NetMatcher(Collection<String> nets, DNSService dnsServer);  NetMatcher(String commaSeparatedNets, DNSService dnsServer); boolean matchInetNetwork(String hostIP); boolean matchInetNetwork(InetAddress ip); @Override String toString(); static final String NETS_SEPARATOR; }
@Test public void testSplitterDoesNotRequireSpaceAfterComma() { netMatcher = new NetMatcher("127.0.0.1,192.168.100.14/24,10.*", DNSFixture.DNS_SERVER_IPV4_MOCK); assertThat(netMatcher.toString()) .isEqualTo("[10.0.0.0/255.0.0.0, 127.0.0.1/255.255.255.255, 192.168.100.0/255.255.255.0]"); }
@Test public void testIpV4NetworksUniqueness() { netMatcher = new NetMatcher(DNSFixture.LOCALHOST_IP_V4_ADDRESSES_DUPLICATE, DNSFixture.DNS_SERVER_IPV4_MOCK); assertThat(netMatcher.toString()).isEqualTo("[172.16.0.0/255.255.0.0, 192.168.1.0/255.255.255.0]"); }
@Test public void testIpV6NetworksUniqueness() { netMatcher = new NetMatcher(DNSFixture.LOCALHOST_IP_V6_ADDRESSES_DUPLICATE, DNSFixture.DNS_SERVER_IPV6_MOCK); assertThat(netMatcher.toString()).isEqualTo("[0:0:0:0:0:0:0:1/32768, 2781:db8:1234:0:0:0:0:0/48]"); }