ContentNode extends MimeTypeNode { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } if (!super.equals(obj)) { return false; } final ContentNode other = (ContentNode) obj; return Objects.equals(this.mimeType, other.mimeType) && Objects.equals(this.size, other.size) && Objects.equals(this.path, other.path); } ContentNode(final String id, final String parentId, final String name, final File file, final MimeType mimeType); Long getSize(); String getPath(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testEquals() throws Exception { File file = File.createTempFile(testName.getMethodName(), "avi"); file.deleteOnExit(); ContentNode node1 = buildContentNode(file); ContentNode node2 = buildContentNode(file); assertEquals(node1, node1); assertEquals(node1, node2); assertNotEquals(node1, null); assertNotEquals(node1, "node1"); }