ComparableVersion implements Comparable<String> { public boolean isInRange(String lowerBound, String upperBound) { return isGreaterThanAndNotEqualTo(lowerBound) && isLessThanAndNotEqualTo(upperBound); } ComparableVersion(String version); @Override int compareTo(String target); boolean isGreaterThanOrEqualTo(String target); boolean isGreaterThanAndNotEqualTo(String target); boolean isLessThanOrEqualTo(String target); boolean isLessThanAndNotEqualTo(String target); boolean isInRange(String lowerBound, String upperBound); boolean isInRange(String range); final String version; }
@Test(expectedExceptions={IllegalArgumentException.class}) public void testError1() { v.isInRange("10.5"); }
@Test(expectedExceptions={IllegalArgumentException.class}) public void testError2() { v.isInRange("[10.5"); }
@Test(expectedExceptions={IllegalArgumentException.class}) public void testError3() { v.isInRange("[10.5]"); }