### Question:
WmsVersion implements Comparable<WmsVersion> { public String toVersionString() { StringBuilder version = new StringBuilder(); version.append(major); if (minor != 0) { version.append('.').append(minor); } if (build != 0) { version.append('.').append(build); } return version.toString(); } WmsVersion(String version);  WmsVersion(int major, int minor, int build); int getMajor(); int getMinor(); int getBuild(); @Override int compareTo(WmsVersion o); @Override String toString(); String toVersionString(); static void validateVersion(String version);  }### Answer:
@Test public void testToVersionString() { WmsVersion version1 = new WmsVersion(1, 0, 0); assertThat(version1.toVersionString(), is("1")); WmsVersion version13 = new WmsVersion(1, 3, 0); assertThat(version13.toVersionString(), is("1.3")); WmsVersion version111 = new WmsVersion(1, 1, 1); assertThat(version111.toVersionString(), is("1.1.1")); }