RobotVersion implements Comparable<RobotVersion> { @Override public int hashCode() { return Objects.hash(major, minor, patch); } RobotVersion(final int major, final int minor);  RobotVersion(final int major, final int minor, final int patch); static RobotVersion from(final String version); boolean isEqualTo(final RobotVersion otherVersion); boolean isNotEqualTo(final RobotVersion otherVersion); boolean isOlderThan(final RobotVersion otherVersion); boolean isOlderThanOrEqualTo(final RobotVersion otherVersion); boolean isNewerThan(final RobotVersion otherVersion); boolean isNewerOrEqualTo(final RobotVersion otherVersion); boolean isDeprecated(); @Override int compareTo(final RobotVersion otherVersion); @Override boolean equals(final Object obj); @Override int hashCode(); String asString(); @Override String toString(); static final RobotVersion UNKNOWN; }
@Test public void hashCodeTest() { assertThat(RobotVersion.from("1.2").hashCode()).isEqualTo(RobotVersion.from("1.2").hashCode()); assertThat(RobotVersion.from("1.2.3").hashCode()).isEqualTo(RobotVersion.from("1.2.3").hashCode()); }