handled null cases in contains and containsAll