code: public static DataSetIterator getIterator(Object o) {
          if (o instanceof DataSetIterator)
              return (DataSetIterator) o;
          else if (o instanceof DataSetIteratorFactory) {
              DataSetIteratorFactory factory = (DataSetIteratorFactory) o;
              return factory.create();
          }
  
          throw new IllegalArgumentException("Type must either be DataSetIterator or DataSetIteratorFactory");
      }
docs: Get a {@link DataSetIterator}
  from the given object whether it's a {@link DataSetIterator}
  or {@link DataSetIteratorFactory}, any other type will throw
  an {@link IllegalArgumentException}
  @param o the object to get the iterator from
  @return the datasetiterator from the given objects