### Question:
VersionComparator { public boolean isNewerThan(VersionComparator comparator) { if (this.major > comparator.getMajor()) { return true; } else if (this.major == comparator.getMajor() && this.minor > comparator.getMinor()) { return true; } else if (this.major == comparator.getMajor() && this.minor == comparator.getMinor() && this.revision > comparator.getRevision()) { return true; } else if (this.major == comparator.getMajor() && this.minor == comparator.getMinor() && this.revision == comparator.getRevision() && this.prereleaseNumber > comparator.getPrereleaseNumber()) { return true; } 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 isNewerThanTest() { VersionComparator vc = new VersionComparator("2.1.0"); Assert.assertFalse(vc.isNewerThan(new VersionComparator("2.1.0"))); Assert.assertFalse(vc.isNewerThan(new VersionComparator("2.2.0"))); Assert.assertFalse(vc.isNewerThan(new VersionComparator("3.0.0"))); Assert.assertTrue(vc.isNewerThan(new VersionComparator("2.0.0"))); Assert.assertTrue(vc.isNewerThan(new VersionComparator("1.9.0"))); }