PropertyValue implements Serializable, Iterable<PropertyValue> { @Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof PropertyValue)) { return false; } PropertyValue dataNode = (PropertyValue) o; return Objects.equals(getKey(), dataNode.getKey()) && Objects.equals(value, dataNode.value); } PropertyValue(String key); protected  PropertyValue(String key, String value); static ObjectValue createObject(); static ListValue createList(); static PropertyValue createValue(String key, String value); static ListValue createList(String key); static ObjectValue createObject(String key); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData); static Map<String, PropertyValue> mapProperties(Map<String, String> config, String source,
                                                           Map<String,String> metaData, String prefix); final boolean isImmutable(); PropertyValue immutable(); PropertyValue mutable(); ValueType getValueType(); final String getKey(); String getValue(); @Deprecated String getSource(); PropertyValue setValue(String value); String getQualifiedKey(); final PropertyValue getParent(); final int getVersion(); final boolean isRoot(); final boolean isLeaf(); final Map<String, String> getMeta(); @Deprecated String getMetaEntry(String key); final T getMeta(String key); int getSize(); @Override Iterator<PropertyValue> iterator(); final PropertyValue setMeta(Map<String, String> metaEntries); final PropertyValue setMeta(String key, Object value); final PropertyValue removeMeta(String key); Map<String,String> toMap(); Map<String,String> toLocalMap(); @Override String toString(); ObjectValue toObjectValue(); ListValue toListValue(); PropertyValue setKey(String key); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testEquals(){ assertThat(new PropertyValue( "k", "v")).isEqualTo(new PropertyValue( "k", "v")); assertThat(new PropertyValue( "k2", "v")).isNotSameAs(new PropertyValue( "k", "v")); assertThat(new PropertyValue( "k", "v")).isNotSameAs(new PropertyValue( "k", "v2")); assertThat(new PropertyValue( "k", "v")).isNotSameAs(new PropertyValue( "k", "v")); }
@Test public void equals() { assertThat(PropertyValue.createObject()).isEqualTo(PropertyValue.createObject()); assertThat(PropertyValue.createObject("a")).isNotEqualTo(PropertyValue.createObject()); assertThat(PropertyValue.createObject("")).isEqualTo(PropertyValue.createObject()); PropertyValue root = PropertyValue.createObject(); assertThat(root).isEqualTo(root); }