### Question:
PageCompareDataLineImpl implements PageCompareDataLine { @Override public boolean equals(Object obj) { if (!(obj instanceof PageCompareDataLineImpl)) { return false; } if (obj == this) { return true; } PageCompareDataLineImpl other = (PageCompareDataLineImpl) obj; return new EqualsBuilder() .append(path, other.getPath()) .append(name, other.getName()) .append(value, other.getValueString()) .isEquals(); } PageCompareDataLineImpl(Property property, String basePath, int depth);   PageCompareDataLineImpl(Resource resource, String basePath, int depth); @Override boolean equals(Object obj); @Override int hashCode(); @Override String getPath(); @Override String getUniqueName(); @Override String getName(); @Override String getValueString(); @Override String getValueStringShort(); @Override int getDepth();  }### Answer:
@Test public void equals_notAnInstance_false() throws Exception { Property property = mockProperty("myValue", "/base/path/relative/path/jcr:content", "propertyName"); PageCompareDataLineImpl underTest = new PageCompareDataLineImpl(property, "/base/path", 1); Object other = "test"; assertFalse(underTest.equals(other)); }
@Test public void equals_samePathNameAndValue_true() throws Exception { Property property = mockProperty("myValue", "/base/path/relative/path/jcr:content", "propertyName"); PageCompareDataLineImpl underTest = new PageCompareDataLineImpl(property, "/base/path", 1); PageCompareDataLineImpl underTest2 = new PageCompareDataLineImpl(property, "/base/path", 1); assertTrue(underTest.equals(underTest2)); }
@Test public void equals_differentValue_false() throws Exception { Property property = mockProperty("myValue", "/base/path/relative/path/jcr:content", "propertyName"); Property property2 = mockProperty("myValue2", "/base/path/relative/path/jcr:content", "propertyName"); PageCompareDataLineImpl underTest = new PageCompareDataLineImpl(property, "/base/path", 1); PageCompareDataLineImpl underTest2 = new PageCompareDataLineImpl(property2, "/base/path", 1); assertFalse(underTest.equals(underTest2)); }
@Test public void equals_sameInstance_true() throws Exception { Property property = mockProperty("myValue", "/base/path/relative/path/jcr:content", "propertyName"); PageCompareDataLineImpl underTest = new PageCompareDataLineImpl(property, "/base/path", 1); assertTrue(underTest.equals(underTest)); }