public < T > Optional < T > min ( Stream < T > stream , Comparator < ? super T > comparator ) { Callable < Optional < T >> callable = ( ) -> stream . min ( comparator ) ; return ThreadMethods . forkJoinExecution ( callable , concurrencyConfiguration , stream . isParallel ( ) ) ; }
Executes min on the provided stream 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 .