I've got four variables and I want to check if any one of them is null. I can do
if (null == a || null == b || null == c || null == d) {
...
}
but what I really want is
if (anyNull(a, b, c, d)) {
...
}
but I don't want to write it myself. Does this function exist in any common Java library? I checked Commons Lang and didn't see it. It should use varargs to take any number of arguments.