public static <T extends Comparable<T>> boolean inRange(final T value, final T closedLowerBound, final T openUpperBound) {
return value.compareTo(closedLowerBound) >= 0 && openUpperBound.compareTo(value) > 0;
}
public static boolean versionInRange(final ReleaseVersion version, final String startInclusive, final String endExclusive) {
final ReleaseVersion start = ReleaseVersion.fromString(startInclusive);
final ReleaseVersion end = ReleaseVersion.fromString(endExclusive);
if (end.getMatchPrecision() != ReleaseVersion.MatchPrecision.BUILD) {
throw new IllegalStateException("Cannot use wildcard as open upper bound of range: " + endExclusive);
}
return inRange(version, start, end);
}