FrontendVersion implements Serializable, Comparable<FrontendVersion> { @Override public boolean equals(Object obj) { if (obj instanceof FrontendVersion) { FrontendVersion other = (FrontendVersion) obj; return majorVersion == other.getMajorVersion() && minorVersion == other.getMinorVersion() && revision == other.getRevision() && buildIdentifier.equals(other.getBuildIdentifier()); } return false; } FrontendVersion(int major, int minor);  FrontendVersion(int major, int minor, int revision);  FrontendVersion(int major, int minor, int revision, String build);  FrontendVersion(String version); String getFullVersion(); int getMajorVersion(); int getMinorVersion(); int getRevision(); String getBuildIdentifier(); boolean isOlderThan(FrontendVersion otherVersion); boolean isNewerThan(FrontendVersion otherVersion); boolean isEqualTo(FrontendVersion otherVersion); @Override boolean equals(Object obj); @Override int hashCode(); @Override int compareTo(FrontendVersion other);  }
@Test public void testFrontedEquality() { FrontendVersion fromString = new FrontendVersion("1.1.0"); FrontendVersion fromConstructor = new FrontendVersion(1, 1); assertTrue("Parsed string didn't equal constructor", fromString.equals(fromConstructor)); assertTrue("Constructor didn't equal parsed string", fromConstructor.equals(fromString)); fromString = new FrontendVersion("1.1.alpha12"); fromConstructor = new FrontendVersion(1, 1, 0, "alpha12"); assertTrue("Major-Minor version with build identifier didn't match", fromConstructor.equals(fromString)); fromString = new FrontendVersion("12.3.5.alpha12"); fromConstructor = new FrontendVersion(12, 3, 5, "alpha12"); assertTrue("Full version with build identifier didn't match", fromString.equals(fromConstructor)); }