public static <T> Iterator<T> asIterator(final T elem) {
    return new BaseIterator<T>() {
      private boolean available = true;

      @Override
      public boolean hasNext() {
        return available;
      }

      @Override
      public T next() {
        if (available) {
          available = false;
          return elem;
        }
        throw new NoSuchElementException();
      }
    };
  }
public static <T> Iterator<T> asIterator(final T elem)