replace univariate function with jdk 8 function