code: public static <T, U> TerminalOp<T, U>
      makeRef(U seed, BiFunction<U, ? super T, U> reducer, BinaryOperator<U> combiner) {
          Objects.requireNonNull(reducer);
          Objects.requireNonNull(combiner);
          class ReducingSink extends Box<U> implements AccumulatingSink<T, U, ReducingSink> {
              @Override
              public void begin(long size) {
                  state = seed;
              }
  
              @Override
              public void accept(T t) {
                  state = reducer.apply(state, t);
              }
  
              @Override
              public void combine(ReducingSink other) {
                  state = combiner.apply(state, other.state);
              }
          }
          return new ReduceOp<T, U, ReducingSink>(StreamShape.REFERENCE) {
              @Override
              public ReducingSink makeSink() {
                  return new ReducingSink();
              }
          };
      }
docs: Constructs a {@code TerminalOp} that implements a functional reduce on
  reference values.
  
  @param <T> the type of the input elements
  @param <U> the type of the result
  @param seed the identity element for the reduction
  @param reducer the accumulating function that incorporates an additional
  input element into the result
  @param combiner the combining function that combines two intermediate
  results
  @return a {@code TerminalOp} implementing the reduction