code: public static <T> Iterator<T> iterator(final Enumeration<T> enumeration) {
          return new Iterator<T>() {
              private T last;
  
              public boolean hasNext() {
                  return enumeration.hasMoreElements();
              }
  
              public T next() {
                  last = enumeration.nextElement();
                  return last;
              }
  
              public void remove() {
                  throw new UnsupportedOperationException("Cannot remove() from an Enumeration");
              }
          };
      }
docs: Allows an Enumeration to behave like an Iterator.  Note that the
  {@link java.util.Iterator#remove() remove()} method is unsupported since the
  underlying Enumeration does not provide a mechanism for removing items.
  
  @param enumeration an Enumeration object
  @return an Iterator for the given Enumeration
  @since 1.0