You could even pass just the variable name and add " == null" in the checkNotNull method.