BackupVersion implements Serializable, Comparable<BackupVersion> { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } BackupVersion other = (BackupVersion) obj; if (major != other.major) { return false; } if (micro != other.micro) { return false; } if (minor != other.minor) { return false; } return true; }  int getMajor(); void setMajor(int major); int getMinor(); void setMinor(int minor); int getMicro(); void setMicro(int micro); static BackupVersion get(); static BackupVersion get(String ver); @Override int compareTo(BackupVersion o); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }
@Test void testEquals() { assertEquals(BackupVersion.get(), BackupVersion.get()); assertNotEquals(BackupVersion.get(), null); assertNotEquals(BackupVersion.get("3.2.1"), BackupVersion.get("3.2.0")); assertNotEquals(BackupVersion.get("3.1.1"), BackupVersion.get("3.0.0")); assertNotEquals(BackupVersion.get("3.1.1"), BackupVersion.get("2.0.0")); }