问题
How can I easily check to see whether all the elements in one ArrayList are all elements of another ArrayList?
回答1:
Use Collection.containsAll():
boolean isSubset = listA.containsAll(listB);
回答2:
There is a containsAll method in all collections.
来源:https://stackoverflow.com/questions/808394/how-to-check-whether-the-elements-of-an-arraylist-are-all-contained-in-another-a