Code example for Proxy

Methods: hashCode

0
 
    public void test_hashCode() { 
        SocketAddress address1 = new InetSocketAddress("127.0.0.1", 1234);
 
        Proxy proxy1 = new Proxy(Proxy.Type.HTTP, address1);
        Proxy proxy2 = new Proxy(Proxy.Type.HTTP, address1);
        assertTrue(proxy1.hashCode() == proxy2.hashCode());
 
        new Proxy(Proxy.Type.SOCKS, address1);
        Proxy proxy4 = new Proxy(Proxy.Type.SOCKS, address1);
        assertTrue(proxy1.hashCode() == proxy2.hashCode());
 
        assertTrue(proxy1.hashCode() != proxy4.hashCode());
 
        SocketAddress address2 = new InetSocketAddress("127.0.0.1", 1235);
 
        Proxy proxy5 = new Proxy(Proxy.Type.SOCKS, address1);
        Proxy proxy6 = new Proxy(Proxy.Type.SOCKS, address2);
        assertTrue(proxy5.hashCode() != proxy6.hashCode());
    } 
Connect your IDE to all the code out there  Get Codota for Java