public double sum ( DoubleStream stream ) { Callable < Double > callable = ( ) -> stream . sum ( ) ; return ThreadMethods . forkJoinExecution ( callable , concurrencyConfiguration , stream . isParallel ( ) ) ; }
Executes sum on the provided DoubleStream using the provided collector . If the Stream is parallel it is executed using the custom pool else it is executed directly from the main thread .