public < U > List < U > scanLeft ( U seed , BiFunction < U , ? super T , U > accumulator ) { List < U > result = new ArrayList <> ( ) ; result . add ( seed ) ; forEachOrdered ( t -> result . add ( accumulator . apply ( result . get ( result . size ( ) - 1 ) , t ) ) ) ; return result ; }
Produces a list containing cumulative results of applying the accumulation function going left to right using given seed value .