Collection<V> () { Set<V> result = new HashSet<>(); Enumeration<? extends V> enumeration = elements(); while (enumeration.hasMoreElements()) { result.add(enumeration.nextElement()); } return result; }