### Question:
Version implements Comparable<Version> { public static Version lookup(String value) { try { return new Version(value); } catch (IllegalArgumentException e) { return null; } } protected  Version(String value); protected  Version(org.osgi.framework.Version version); protected  Version(Component<?> version); static Version lookup(String value); final boolean isTransition(); Version getNext(); Version getTransition(Version destination); Version get(int index); Version get(String key); Version replace(int index, Version element); Version replace(String key, Version element); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode(); @Override int compareTo(Version other); static final Version INITIAL; }### Answer:
@Test(groups = { TestGroups.UNIT }) public void testLookupWithConstant() throws Exception { String[] hasConstant = {"1.0", "1.5", "2.0.0"}; for (String s : hasConstant) { Assert.assertNotNull(Version.lookup(s)); } }
@Test(groups = { TestGroups.UNIT }) public void testLookupWithoutConstant() throws Exception { String[] noConstant = {"0.9", "1.3", "3"}; for (String s : noConstant) { Assert.assertNotNull(Version.lookup(s)); } }
@Test(groups = { TestGroups.UNIT }) public void testInvalidLookup() throws Exception { String[] invalid = {"1.3.4.5.6", "foobarbaz"}; for (String s : invalid) { Assert.assertNull(Version.lookup(s)); } }