I want to verify whether a collection is empty and null. Could anyone please let me know the best practice.
null
Currently, I am checking as below:
You can use org.apache.commons.lang.Validate's "notEmpty" method:
org.apache.commons.lang.Validate
Validate.notEmpty(myCollection) -> Validate that the specified argument collection is neither null nor a size of zero (no elements); otherwise throwing an exception.
Validate.notEmpty(myCollection)