Use isEmpty() to check whether the collection is empty or not.