java Collection 中 containsAll 与 retainAll 的区别
public static void main(String[] args) {
Collection collection1 = new ArrayList();
collection1.add("a");
collection1.add("b");
collection1.add("c");
Collection collection2 = new ArrayList();
collection2.add("a");
collection2.add("b");
collection2.add("c");
System.out.println(collection1);
boolean flag = collection1.retainAll(collection2);
System.out.println(flag);
System.out.println(collection1);
boolean flag1 = collection1.containsAll(collection2);
System.out.println(flag1);
System.out.println(collection1);
}