Is List<List<String>> an instance of Collection<Collection<T>>?
问题 I wrote this handy, generic function for converting a collection of collections into a single set: public static <T> Set<T> makeSet(Collection<Collection<T>> a_collection) { Iterator<Collection<T>> it = a_collection.iterator(); Set<T> result = new HashSet<T>(); while (it.hasNext()) { result.addAll(it.next()); } return result; } Then I tried to call it: List<List<String>> resultLists = ... ; Set<String> labelsSet = CollectionsHelper.makeSet(resultLists); and I received the following error: <T