TransportConfiguration implements Serializable { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; TransportConfiguration that = (TransportConfiguration) o; if (!isSameParams(that)) { return false; } if (name != null ? !name.equals(that.name) : that.name != null) return false; return true; } TransportConfiguration();  TransportConfiguration(final String className, final Map<String, Object> params, final String name);  TransportConfiguration(final String className,
                                 final Map<String, Object> params,
                                 final String name,
                                 final Map<String, Object> extraProps);  TransportConfiguration(final String className, final Map<String, Object> params);  TransportConfiguration(final String className); JsonObject toJson(); static String[] splitHosts(final String commaSeparatedHosts); TransportConfiguration newTransportConfig(String newName); String getName(); String getFactoryClassName(); Map<String, Object> getParams(); Map<String, Object> getExtraParams(); Map<String, Object> getCombinedParams(); @Override int hashCode(); @Override boolean equals(Object o); boolean isSameParams(TransportConfiguration that); boolean isEquivalent(TransportConfiguration otherConfig); @Override String toString(); static String toStringParameters(Map<String, Object> params, Map<String, Object> extraProps); void encode(final ActiveMQBuffer buffer); void decode(final ActiveMQBuffer buffer); void setFactoryClassName(String factoryClassName);  }
@Test public void testEquals() { TransportConfiguration configuration = new TransportConfiguration("SomeClass", new HashMap<String, Object>(), null); TransportConfiguration configuration2 = new TransportConfiguration("SomeClass", new HashMap<String, Object>(), null); Assert.assertEquals(configuration, configuration2); Assert.assertEquals(configuration.hashCode(), configuration2.hashCode()); HashMap<String, Object> configMap1 = new HashMap<>(); configMap1.put("host", "localhost"); HashMap<String, Object> configMap2 = new HashMap<>(); configMap2.put("host", "localhost"); configuration = new TransportConfiguration("SomeClass", configMap1, null); configuration2 = new TransportConfiguration("SomeClass", configMap2, null); Assert.assertEquals(configuration, configuration2); Assert.assertEquals(configuration.hashCode(), configuration2.hashCode()); configuration = new TransportConfiguration("SomeClass", configMap1, "name1"); configuration2 = new TransportConfiguration("SomeClass", configMap2, "name2"); Assert.assertNotEquals(configuration, configuration2); Assert.assertNotEquals(configuration.hashCode(), configuration2.hashCode()); Assert.assertTrue(configuration.isEquivalent(configuration2)); configMap1 = new HashMap<>(); configMap1.put("host", "localhost"); configMap2 = new HashMap<>(); configMap2.put("host", "localhost3"); configuration = new TransportConfiguration("SomeClass", configMap1, null); configuration2 = new TransportConfiguration("SomeClass", configMap2, null); Assert.assertNotEquals(configuration, configuration2); Assert.assertNotEquals(configuration.hashCode(), configuration2.hashCode()); }