code: public static <T> Collection<T> flatten(Iterable<T> self, Closure<? extends T> flattenUsing) {
          return flatten(self, createSimilarCollection(self), flattenUsing);
      }
docs: Flatten an Iterable.  This Iterable and any nested arrays or
  collections have their contents (recursively) added to the new collection.
  For any non-Array, non-Collection object which represents some sort
  of collective type, the supplied closure should yield the contained items;
  otherwise, the closure should just return any element which corresponds to a leaf.
  
  @param self an Iterable
  @param flattenUsing a closure to determine how to flatten non-Array, non-Collection elements
  @return a flattened Collection
  @since 1.6.0