@Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((host == null) ? 0 : host.hashCode());
        result = prime * result + port;
        result = prime * result
            + ((protocol == null) ? 0 : protocol.hashCode());
        return result;
    }
@Test
    public void testHashCode() {
        ServerConfig config1 = new ServerConfig();
        ServerConfig config2 = new ServerConfig();
        config1.setHost("127.0.0.1").setPort(1234).setProtocol("xxx");
        config2.setHost("127.0.0.1").setPort(1235).setProtocol("xxx");
        Assert.assertFalse(config1.hashCode() == config2.hashCode());
        config2.setPort(1234);
        Assert.assertTrue(config1.hashCode() == config2.hashCode());
    }