code: public static DoubleUnaryOperator doubleUnaryOperator(CheckedDoubleUnaryOperator operator, Consumer<Throwable> handler) {
          return t -> {
              try {
                  return operator.applyAsDouble(t);
              }
              catch (Throwable e) {
                  handler.accept(e);
  
                  throw new IllegalStateException("Exception handler must throw a RuntimeException", e);
              }
          };
      }
docs: Wrap a {@link CheckedDoubleUnaryOperator} in a {@link DoubleUnaryOperator} with a custom handler for checked exceptions.
  <p>
  Example:
  <code><pre>
  LongStream.of(1.0, 2.0, 3.0).map(Unchecked.doubleUnaryOperator(
  d -> {
  if (d &lt; 0.0)
  throw new Exception("Only positive numbers allowed");
  
  return d;
  },
  e -> {
  throw new IllegalStateException(e);
  }
  ));
  </pre></code>