@Override
    public int hashCode() {
        int result = protocol.hashCode();
        result = 31 * result + (address != null ? address.hashCode() : 0);
        result = 31 * result + (index != null ? index.hashCode() : 0);
        result = 31 * result + (register ? 1 : 0);
        result = 31 * result + (subscribe ? 1 : 0);
        result = 31 * result + timeout;
        result = 31 * result + connectTimeout;
        result = 31 * result + (file != null ? file.hashCode() : 0);
        result = 31 * result + (batch ? 1 : 0);
        result = 31 * result + batchSize;
        result = 31 * result + heartbeatPeriod;
        result = 31 * result + reconnectPeriod;
        result = 31 * result + (parameters != null ? parameters.hashCode() : 0);
        return result;
    }
@Test
    public void testHashCode() {
        RegistryConfig config1 = new RegistryConfig();
        RegistryConfig config2 = new RegistryConfig();
        config1.setAddress("127.0.0.1:1234").setProtocol("xxx");
        config2.setAddress("127.0.0.1:1234").setProtocol("yyy");
        Assert.assertFalse(config1.hashCode() == config2.hashCode());
        config2.setProtocol("xxx");
        Assert.assertTrue(config1.hashCode() == config2.hashCode());
    }