I like guava preconditions, but what I really need from it is one more method - check that the number is in range. Smt like this
//probably there should be checkStateInRange also
public static void checkArgumentInRange(double value, int min, int max) {
if (value < min || value > max) {
throw new IllegalArgumentException(String.format("%s must be in range [%s, %s]", value, min, max));
}
}
I believe I'm not alone and it's a pretty common case. But such method doesn't exist. Is there any reasons to not put such methods in com.google.common.base.Preconditions
?