code: public static final Iterator createIterator(Object object) {
          LOGGER.debug("Create an iterator for class: " + (object == null ? "null" : object.getClass().getName()));
  
          if(object == null)
              return null;
  
          if(object instanceof Iterator) {
              return (Iterator)object;
          } else if(object instanceof Collection) {
              Collection collection = (Collection)object;
              return collection.iterator();
          } else if(object instanceof Map) {
              return new MapIterator((Map)object);
          } else if(object.getClass().isArray()) {
              return new ArrayIterator(object);
          } else if(object instanceof Enumeration)
              return new EnumerationIterator((Enumeration)object);
          else if(object instanceof ResultSet && !(object instanceof RowSet))
              return new ResultSetIterator((ResultSet)object);
  
          // check to see if there is a registered IteratorPlant that can handle this type
          Iterator ret = null;
          Iterator factories = ITERATOR_FACTORIES.keySet().iterator();
          while(factories.hasNext()) {
              IteratorPlant plant = (IteratorPlant)ITERATOR_FACTORIES.get(factories.next());
              ret = plant.createIterator(object);
  
              if(ret != null) return ret;
          }
  
          return new AtomicObjectIterator(object);
      }
docs: Create a new {@link Iterator} for the supplied object.
  
  @param object the object to build an iterator from
  @return an {@link Iterator} for the <code>object</code> or <code>null</code> if the value is null.