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:
For all the collections including map use: isEmpty method which is there on these collection objects. But you have to do a null check before:
isEmpty
Map map; ........ if(map!=null && !map.isEmpty()) ......