### Question:
VersionHistory implements Serializable { @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj.getClass() != getClass()) { return false; } VersionHistory other = (VersionHistory) obj; return entries.equals(other.entries); }  TreeMap<Integer, HistoryNode> calculateNodes(); int getVersionCount(); VersionHistoryEntry getLastEntry(); void addRestore(UUID streamId, int restoredSnapshotNr); void addVersion(UUID streamId); boolean isAncestorOf(VersionHistory child); @Override boolean equals(Object obj); @Override String toString();  }### Answer:
@Test public void testEquals() throws Exception { VersionHistory history1 = new VersionHistory(); VersionHistory history2 = new VersionHistory(); UUID id = UUID.randomUUID(); assertEquals(history1, history2); history1.addVersion(id); assertNotEquals(history1, history2); history2.addVersion(id); assertEquals(history1, history2); history1.addVersion(id); id = UUID.randomUUID(); history2.addVersion(id); assertNotEquals(history1, history2); }