src/main/java/org/jboss/util/collection/Iterators.java
/**
    * Returns an Iterator containing the <i>union</i> of all of the elements
    * in the given iterator array.
    *
    * @param iters   Array of iterators.
    * @return        Iterator containing the <i>union</i>.
    */
Returns an Iterator containing the union of all of the elements
in the given iterator array.

@param iters   Array of iterators.
@return        Iterator containing the union.
Returns an Iterator containing the union of all of the elements in the given iterator array . @param iters Array of iterators . @return Iterator containing the union .
public static Iterator union(final Iterator iters[]) {
      Map map = new HashMap();
      for (int i=0; i < iters.length; i++) {
         if (iters[i] != null) {
            while (iters[i].hasNext()) {
               Object obj = iters[i].next();
               if (!map.containsKey(obj)) {
                  map.put(obj, Null.VALUE);
               }
            }
         }
      }
      return map.keySet().iterator();
   }
public static Iterator union ( final Iterator iters [ ] ) { Map map = new HashMap ( ) ; for ( int i = 0 ; i < iters . length ; i ++ ) { if ( iters [ i ] != null ) { while ( iters [ i ] . hasNext ( ) ) { Object obj = iters [ i ] . next ( ) ; if ( ! map . containsKey ( obj ) ) { map . put ( obj , Null . VALUE ) ; } } } } return map . keySet ( ) . iterator ( ) ; }
Returns an Iterator containing the <i>union</i> of all of the elements
 in the given iterator array.
Returns an Iterator containing the <i > union< / i > of all of the elements in the given iterator array .