Use Preconditions.checkArgument for this validation