[java] Best practice to validate null and empty collection in Java