Version implements Comparable<Version> { @Override public String toString() { return asString; } Version(String s); static Version create(String version); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Version o); @Override String toString(); boolean isGreaterThan(int major, int minor); boolean isGreaterThanOrEquals(int major, int minor); int getMajor(); int getMinor(); int getPatch(); boolean isRelease(); boolean isSnapshot();  }
@Test public void test_toString() { Version underTest = new Version("1.2.3.4"); assertThat(underTest.toString()).isEqualTo("1.2.3.4"); underTest = new Version("1.2"); assertThat(underTest.toString()).isEqualTo("1.2"); underTest = new Version("1.2.3"); assertThat(underTest.toString()).isEqualTo("1.2.3"); underTest = new Version("1.2.3.456789"); assertThat(underTest.toString()).isEqualTo("1.2.3.456789"); underTest = new Version("9999.9999.9999.999999"); assertThat(underTest.toString()).isEqualTo("9999.9999.9999.999999"); underTest = new Version("1.2-M7_2016-03-30"); assertThat(underTest.toString()).isEqualTo("1.2-M7_2016-03-30"); underTest = new Version("2-M8_2016-03"); assertThat(underTest.toString()).isEqualTo("2-M8_2016-03"); }