@Test
public void testPeerTrusted() throws Exception{

    TrustedPeer peer1 = TrustedPeer.asNode("node-1", "1.1.1.1");
    TrustedPeer peer2 = TrustedPeer.asNode("node-2", "2.1.1.*");
    TrustedPeer peer3 = TrustedPeer.asNode("node-2", "3.*");
    Config config = createTrustedPeersConfig(peer1, peer2, peer3);
    SystemProperties props = new SystemProperties();
    props.overrideParams(config);
    NodeFilter filter = props.peerTrusted();
    assertTrue(filter.accept(InetAddress.getByName("1.1.1.1")));
    assertTrue(filter.accept(InetAddress.getByName("2.1.1.1")));
    assertTrue(filter.accept(InetAddress.getByName("2.1.1.9")));
    assertTrue(filter.accept(InetAddress.getByName("3.1.1.1")));
    assertTrue(filter.accept(InetAddress.getByName("3.1.1.9")));
    assertTrue(filter.accept(InetAddress.getByName("3.9.1.9")));
    assertFalse(filter.accept(InetAddress.getByName("4.1.1.1")));
}