### Question:
VersionComparator { @Override public boolean equals(Object object) { if (object instanceof VersionComparator) { final VersionComparator comparator = (VersionComparator) object; return this.major == comparator.getMajor() && this.minor == comparator.getMinor() && this.revision == comparator.getRevision() && this.isSnapshot == comparator.isSnapshot() && this.prereleaseNumber == comparator.getPrereleaseNumber(); } return false; } VersionComparator(String version); boolean isNewerThan(VersionComparator comparator); boolean isOlderThan(VersionComparator comparator); @Override boolean equals(Object object); @Override int hashCode(); int getMajor(); int getMinor(); int getRevision(); boolean isSnapshot(); int getPrereleaseNumber(); @Override String toString();  }### Answer:
@Test public void equalsTest() { VersionComparator vc = new VersionComparator("2.1.0"); Assert.assertTrue(vc.equals(new VersionComparator("2.1.0"))); Assert.assertFalse(vc.equals(new VersionComparator("2.2.0"))); Assert.assertFalse(vc.equals(new VersionComparator("3.0.0"))); Assert.assertFalse(vc.equals(new VersionComparator("2.0.0"))); Assert.assertFalse(vc.equals(new VersionComparator("1.9.0"))); }