I know this is quite an old question, but with Java 8's Streams you can get a range of int
s like this:
// gives an IntStream of integers from 0 through Integer.MAX_VALUE
IntStream.rangeClosed(0, Integer.MAX_VALUE);
Then you can do something like this:
if (IntStream.rangeClosed(0, Integer.MAX_VALUE).matchAny(n -> n == A)) {
// do something
} else {
// do something else
}