src/main/php/Collectors.php
public function with(callable $supplier, callable $accumulator, callable $finisher = null)
    {
        return $this->sequence->collect(new Collector($supplier, $accumulator, $finisher));
    }
public function with(callable $supplier, callable $accumulator, callable $finisher = null)
    {
        return $this->sequence->collect(new Collector($supplier, $accumulator, $finisher));
    }
public function with ( callable $ supplier , callable $ accumulator , callable $ finisher = null ) { return $ this -> sequence -> collect ( new Collector ( $ supplier , $ accumulator , $ finisher ) ) ; }
collects all elements into structure defined by supplier

@api
@param   callable  $supplier     returns a fresh structure to collect elements into
@param   callable  $accumulator  accumulates elements into structure
@param   callable  $finisher     optional  final operation after all elements have been added to the structure
@return  mixed
collects all elements into structure defined by supplier