Pulled varargs test out of the loop to avoid checking on each parameter