code: public static LongBinaryOperator longBinaryOperator(CheckedLongBinaryOperator operator, Consumer<Throwable> handler) {
          return (l1, l2) -> {
              try {
                  return operator.applyAsLong(l1, l2);
              }
              catch (Throwable e) {
                  handler.accept(e);
  
                  throw new IllegalStateException("Exception handler must throw a RuntimeException", e);
              }
          };
      }
docs: Wrap a {@link CheckedLongBinaryOperator} in a {@link LongBinaryOperator} with a custom handler for checked exceptions.
  <p>
  Example:
  <code><pre>
  LongStream.of(1L, 2L, 3L).reduce(Unchecked.longBinaryOperator(
  (l1, l2) -> {
  if (l2 &lt; 0L)
  throw new Exception("Only positive numbers allowed");
  
  return l1 + l2;
  },
  e -> {
  throw new IllegalStateException(e);
  }
  ));
  </pre></code>