### Question:
Configuration implements Serializable, Cloneable, AbstractPropertyMap { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof Configuration)) { return false; } Configuration that = (Configuration) obj; if (this.properties == null || this.properties.isEmpty()){ if ( that.properties== null || that.properties.isEmpty()) { return true; } else { return false; } } else { if (!this.properties.equals(that.properties)) { return false; } } boolean rcEquals=true; if (this.rawConfigurations!=null) { rcEquals = this.getRawConfigurations().equals(that.getRawConfigurations()); } return rcEquals; } Configuration(); static Builder builder(); int getId(); void setId(int id); long getCreatedTime(); long getModifiedTime(); @Override void put(Property value); @Override Property get(String name); Property remove(String name); @Override PropertySimple getSimple(String name); String getSimpleValue(String name); String getSimpleValue(String name, @Nullable String defaultValue); void setSimpleValue(String name, String value); @Override PropertyList getList(String name); @Override PropertyMap getMap(String name); @Override @NotNull Map<String, Property> getMap(); @NotNull Collection<String> getNames(); @NotNull @XmlElementRefs({ @XmlElementRef(name = "PropertyList", type = PropertyList.class), @XmlElementRef(name = "PropertySimple", type = PropertySimple.class), @XmlElementRef(name = "PropertyMap", type = PropertyMap.class) }) Collection<Property> getProperties(); void setProperties(Collection<Property> properties); @NotNull Map<String, PropertyMap> getMapProperties(); @NotNull Map<String, PropertyList> getListProperties(); @NotNull Map<String, PropertySimple> getSimpleProperties(); Set<RawConfiguration> getRawConfigurations(); void addRawConfiguration(RawConfiguration rawConfiguration); boolean removeRawConfiguration(RawConfiguration rawConfiguration); void cleanoutRawConfiguration(); void resize(); String getNotes(); void setNotes(String notes); long getVersion(); void setVersion(long version); @SuppressWarnings("override") //@Override //GWT trips over this, WTH! Configuration clone(); Configuration deepCopy(); Configuration deepCopy(boolean keepIds); void replaceWithConfig(Configuration config); Configuration deepCopyWithoutProxies(); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString(); String toString(boolean verbose); void afterUnmarshal(Object u, Object parent); Map<String, Property> getAllProperties(); @SuppressWarnings("unchecked") @Deprecated static Iterator<T> emptyIterator(); static final String QUERY_GET_PLUGIN_CONFIG_BY_RESOURCE_ID; static final String QUERY_GET_RESOURCE_CONFIG_BY_RESOURCE_ID; static final String QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_ID; static final String QUERY_GET_PLUGIN_CONFIG_MAP_BY_GROUP_ID; static final String QUERY_GET_RESOURCE_CONFIG_MAP_BY_GROUP_UPDATE_ID; static final String QUERY_GET_PLUGIN_CONFIG_MAP_BY_GROUP_UPDATE_ID; static final String QUERY_BREAK_PROPERTY_RECURSION_BY_CONFIGURATION_IDS; static final String QUERY_DELETE_RAW_CONFIGURATIONS_CONFIGURATION_IDS; static final String QUERY_DELETE_CONFIGURATIONS_BY_CONFIGURATION_IDs; }### Answer:
@Test public void equalsShouldBeFalseWhenArgumentIsNull() { Configuration config = new Configuration(); assertFalse(config.equals(null), "equals() should be false for null argument."); }
@Test public void equalsShouldBeFalseWhenArgumentIsNotAConfiguration() { Configuration config = new Configuration(); assertFalse(config.equals(new Object()), "equals should return false when argument is not a " + Configuration.class.getSimpleName()); }
@Test public void equalsShouldBeReflexive() { Configuration config = new Configuration(); assertTrue(config.equals(config), "equals() should be reflexive."); }