Version implements Comparable<Version>, Serializable { public Version(final String version) { this((CharSequence) version); } Version(final String version);  Version(final CharSequence version); @Override @SuppressWarnings("unchecked") int compareTo(final Version o); @Override int hashCode(); @Override boolean equals(final Object obj); String getImage(); Comparable[] getComponents(); Comparable getComponent(final int pos); @SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX") int getMajor(); @SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX") int getMinor(); @SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX") int getPatch(); int getNrComponents(); @Override String toString();  }
@Test @SuppressFBWarnings("CLI_CONSTANT_LIST_INDEX") public void testVersion() { Version version1 = new Version("1.u1.3"); Version version2 = new Version("1.u10.3"); Assert.assertTrue(version1.compareTo(version2) < 0); LOG.debug("version1 = {}", version1); Assert.assertEquals(Integer.valueOf(3), version1.getComponents()[3]); Version javaVersion = new Version(org.spf4j.base.Runtime.JAVA_VERSION); LOG.debug("version1 = {}, image = {}", javaVersion, javaVersion.getImage()); Assert.assertTrue(javaVersion.compareTo(new Version("1.6.0_1")) > 0); }