code: public static <T> Set<T> enumerationToSet(Enumeration<T> enumeration) {
          Set<T> set = new HashSet<>();
          while (enumeration.hasMoreElements()) {
              set.add(enumeration.nextElement());
          }
          return set;
      }
docs: Convert an {@link Enumeration} to a {@link Set}.
  
  @param enumeration The iterator
  @param <T>         The type
  @return The set