how is a==b false when running in parallel but when used with combiner it works?
public class test {
public static int cal(final int i) {
return 1;
}
public static void main(String args[]) {
int a = IntStream.range(0, 3).reduce(0, (abc, cde) -> abc + cal(cde));
int b = IntStream.range(0, 3).parallel().reduce(0, (abc, cde) -> abc + cal(cde));
System.out.println(a == b); // false
int c = List.of(0, 1, 2).stream().parallel().reduce(0, (abc, cde) -> abc + cal(cde), Integer::sum);
System.out.println(a == c); // true
}
}