static Set similarEmptySet(Iterable m) { if (m instanceof TreeSet) ret new TreeSet(((TreeSet) m).comparator()); if (m instanceof LinkedHashSet) ret new LinkedHashSet; ret new HashSet; } static Set similarEmptySet(Map m) { if (m instanceof TreeMap) ret new TreeSet(((TreeMap) m).comparator()); if (m instanceof LinkedHashMap) ret new LinkedHashSet; ret new HashSet; }