@Test
public void testNonLoopback() throws Exception {
for (Map.Entry<NetworkInterface, Set<Inet6Address>> entry : addresses.entrySet()) {
NetworkInterface nif = entry.getKey();
for (Inet6Address address : entry.getValue()) {
String hostAddress = address.getHostAddress();
int pos = hostAddress.indexOf('%');
if (pos > -1) {
hostAddress = hostAddress.substring(0, pos);
}
InetAddressMatchInterfaceCriteria criteria = new InetAddressMatchInterfaceCriteria(new ModelNode(hostAddress));
assertEquals(address, criteria.isAcceptable(nif, address));
criteria = new InetAddressMatchInterfaceCriteria(new ModelNode(hostAddress + "%" + nif.getName()));
assertEquals(address, criteria.isAcceptable(nif, address));
criteria = new InetAddressMatchInterfaceCriteria(new ModelNode(hostAddress + "%" + address.getScopeId()));
assertEquals(address, criteria.isAcceptable(nif, address));
criteria = new InetAddressMatchInterfaceCriteria(new ModelNode(hostAddress + "%" + (address.getScopeId() + 1)));
assertNull(criteria.isAcceptable(nif, address));