static < T > Set < T > reduceSet ( Iterator < Set < T > > values ) { Set < T > set = new HashSet <> ( ) ; while ( values . hasNext ( ) ) { set . addAll ( values . next ( ) ) ; } return set ; }
A helper method for set MapReduce . It simply combines sets into one set .