返回只包含特定对象的集合,集合size为1.
String init[] = { "One", "Two", "Three", "One", "Two", "Three" };
List list1 = new ArrayList(Arrays.asList(init));
List list2 = new ArrayList(Arrays.asList(init));
list1.remove("One");
System.out.println(list1);
// [Two, Three, One, Two, Three]
list2.removeAll(Collections.singleton("One"));
System.out.println(list2);
// [Two, Three, Two, Three]