code: public static DoublePredicate doublePredicate(CheckedDoublePredicate function, Consumer<Throwable> handler) {
          return d -> {
              try {
                  return function.test(d);
              }
              catch (Throwable e) {
                  handler.accept(e);
  
                  throw new IllegalStateException("Exception handler must throw a RuntimeException", e);
              }
          };
      }
docs: Wrap a {@link CheckedDoublePredicate} in a {@link DoublePredicate} with a custom handler for checked exceptions.
  <p>
  Example:
  <code><pre>
  DoubleStream.of(1.0, 2.0, 3.0).filter(Unchecked.doublePredicate(
  d -> {
  if (d &lt; 0.0)
  throw new Exception("Only positive numbers allowed");
  
  return true;
  },
  e -> {
  throw new IllegalStateException(e);
  }
  ));
  </pre></code>