我该如何轻松地检查一个 ArrayList 中的所有元素是否都属于另一个 ArrayList?
使用Collection.containsAll()方法:
boolean isSubset = listA.containsAll(listB);
所有集合类都有一个containsAll方法。