code: public <R> R collect(Func1<Iterable<T>, R> collector) {
          return collector.call(this);
      }
docs: Converts the current stream into any value with a given method.
  
  @param collector a method that should be used to return value.
  @param <R>       a type of value to return.
  @return a value that has been returned by the given collecting method.