@Test public void testEquals() { Map<String, Object> mapProps = new HashMap<String, Object>(); mapProps.put("foo", "bar"); NamedPropertySet propertySet = new NamedPropertySet("foo", mapProps); NamedPropertySet propertySet2 = new NamedPropertySet("foo", mapProps); assertEquals(propertySet, propertySet2); NamedPropertySet propertySet3 = new NamedPropertySet("bar", mapProps); assertFalse(propertySet.equals(propertySet3)); NamedPropertySet propertySet4 = new NamedPropertySet("foo", new HashMap<String, Object>()); assertFalse(propertySet.equals(propertySet4)); }
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NamedPropertySet that = (NamedPropertySet) o; return (m_mapProperties == null ? that.m_mapProperties == null : m_mapProperties.equals(that.m_mapProperties)) && (m_name == null ? that.m_name == null : m_name.equals(that.m_name)); }
NamedPropertySet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NamedPropertySet that = (NamedPropertySet) o; return (m_mapProperties == null ? that.m_mapProperties == null : m_mapProperties.equals(that.m_mapProperties)) && (m_name == null ? that.m_name == null : m_name.equals(that.m_name)); } }
NamedPropertySet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NamedPropertySet that = (NamedPropertySet) o; return (m_mapProperties == null ? that.m_mapProperties == null : m_mapProperties.equals(that.m_mapProperties)) && (m_name == null ? that.m_name == null : m_name.equals(that.m_name)); } NamedPropertySet(String name, Map<String, Object> mapProperties); }
NamedPropertySet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NamedPropertySet that = (NamedPropertySet) o; return (m_mapProperties == null ? that.m_mapProperties == null : m_mapProperties.equals(that.m_mapProperties)) && (m_name == null ? that.m_name == null : m_name.equals(that.m_name)); } NamedPropertySet(String name, Map<String, Object> mapProperties); String getName(); Map<String, Object> getProperties(); @Override boolean equals(Object o); @Override int hashCode(); }
NamedPropertySet { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; NamedPropertySet that = (NamedPropertySet) o; return (m_mapProperties == null ? that.m_mapProperties == null : m_mapProperties.equals(that.m_mapProperties)) && (m_name == null ? that.m_name == null : m_name.equals(that.m_name)); } NamedPropertySet(String name, Map<String, Object> mapProperties); String getName(); Map<String, Object> getProperties(); @Override boolean equals(Object o); @Override int hashCode();  }