RegistryConfig extends AbstractIdConfig implements Serializable { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof RegistryConfig)) { return false; } RegistryConfig that = (RegistryConfig) o; if (register != that.register) { return false; } if (subscribe != that.subscribe) { return false; } if (timeout != that.timeout) { return false; } if (connectTimeout != that.connectTimeout) { return false; } if (batch != that.batch) { return false; } if (batchSize != that.batchSize) { return false; } if (heartbeatPeriod != that.heartbeatPeriod) { return false; } if (reconnectPeriod != that.reconnectPeriod) { return false; } if (!protocol.equals(that.protocol)) { return false; } if (address != null ? !address.equals(that.address) : that.address != null) { return false; } if (index != null ? !index.equals(that.index) : that.index != null) { return false; } if (file != null ? !file.equals(that.file) : that.file != null) { return false; } return parameters != null ? parameters.equals(that.parameters) : that.parameters == null; }  String getProtocol(); RegistryConfig setProtocol(String protocol); String getAddress(); RegistryConfig setAddress(String address); String getIndex(); RegistryConfig setIndex(String index); boolean isRegister(); RegistryConfig setRegister(boolean register); boolean isSubscribe(); RegistryConfig setSubscribe(boolean subscribe); int getTimeout(); RegistryConfig setTimeout(int timeout); int getConnectTimeout(); RegistryConfig setConnectTimeout(int connectTimeout); String getFile(); RegistryConfig setFile(String file); boolean isBatch(); RegistryConfig setBatch(boolean batch); int getBatchSize(); RegistryConfig setBatchSize(int batchSize); int getHeartbeatPeriod(); RegistryConfig setHeartbeatPeriod(int heartbeatPeriod); int getReconnectPeriod(); RegistryConfig setReconnectPeriod(int reconnectPeriod); Map<String, String> getParameters(); RegistryConfig setParameters(Map<String, String> parameters); RegistryConfig setParameter(String key, String value); String getParameter(String key); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals() { RegistryConfig config1 = new RegistryConfig(); Assert.assertTrue(config1.equals(config1)); Assert.assertFalse(config1.equals(null)); Assert.assertFalse(config1.equals("")); RegistryConfig config2 = new RegistryConfig(); Assert.assertTrue(config1.equals(config2)); config1.setRegister(!config1.isRegister()); Assert.assertFalse(config1.equals(config2)); config2.setRegister(!config2.isRegister()); Assert.assertTrue(config1.equals(config2)); config1.setSubscribe(!config1.isSubscribe()); Assert.assertFalse(config1.equals(config2)); config2.setSubscribe(!config2.isSubscribe()); Assert.assertTrue(config1.equals(config2)); config1.setTimeout(9998); Assert.assertFalse(config1.equals(config2)); config2.setTimeout(9997); Assert.assertFalse(config1.equals(config2)); config2.setTimeout(9998); Assert.assertTrue(config1.equals(config2)); config1.setConnectTimeout(9998); Assert.assertFalse(config1.equals(config2)); config2.setConnectTimeout(9997); Assert.assertFalse(config1.equals(config2)); config2.setConnectTimeout(9998); Assert.assertTrue(config1.equals(config2)); config1.setBatch(!config1.isBatch()); Assert.assertFalse(config1.equals(config2)); config2.setBatch(!config2.isBatch()); Assert.assertTrue(config1.equals(config2)); config1.setBatchSize(9998); Assert.assertFalse(config1.equals(config2)); config2.setBatchSize(9997); Assert.assertFalse(config1.equals(config2)); config2.setBatchSize(9998); Assert.assertTrue(config1.equals(config2)); config1.setHeartbeatPeriod(9998); Assert.assertFalse(config1.equals(config2)); config2.setHeartbeatPeriod(9997); Assert.assertFalse(config1.equals(config2)); config2.setHeartbeatPeriod(9998); Assert.assertTrue(config1.equals(config2)); config1.setReconnectPeriod(9998); Assert.assertFalse(config1.equals(config2)); config2.setReconnectPeriod(9997); Assert.assertFalse(config1.equals(config2)); config2.setReconnectPeriod(9998); Assert.assertTrue(config1.equals(config2)); config1.setProtocol("xxx"); Assert.assertFalse(config1.equals(config2)); config2.setProtocol("yyy"); Assert.assertFalse(config1.equals(config2)); config2.setProtocol("xxx"); Assert.assertTrue(config1.equals(config2)); config1.setAddress("xxx"); Assert.assertFalse(config1.equals(config2)); config2.setAddress("yyy"); Assert.assertFalse(config1.equals(config2)); config2.setAddress("xxx"); Assert.assertTrue(config1.equals(config2)); config1.setIndex("xxx"); Assert.assertFalse(config1.equals(config2)); config2.setIndex("yyy"); Assert.assertFalse(config1.equals(config2)); config2.setIndex("xxx"); Assert.assertTrue(config1.equals(config2)); config1.setFile("xxx"); Assert.assertFalse(config1.equals(config2)); config2.setFile("yyy"); Assert.assertFalse(config1.equals(config2)); config2.setFile("xxx"); Assert.assertTrue(config1.equals(config2)); config1.setParameter("xxx", "xxx"); Assert.assertFalse(config1.equals(config2)); config2.setParameter("xxx", "yyy"); Assert.assertFalse(config1.equals(config2)); config2.setParameter("xxx", "xxx"); Assert.assertTrue(config1.equals(config2)); }