views:

618

answers:

2

How can I easily check to see if one ArrayList object is contained as a subset of another?

+10  A: 

Use Collection.containsAll():

boolean isSubset = listA.containsAll(listB);
Daniel Lew
+1  A: 

There is a containsAll method in all collections.

Uri