public static LongSupplier longSupplier(CheckedLongSupplier supplier, Consumer<Throwable> handler) {
        return () -> {
            try {
                return supplier.getAsLong();
            }
            catch (Throwable e) {
                handler.accept(e);

                throw new IllegalStateException("Exception handler must throw a RuntimeException", e);
            }
        };
    }
Wrap a {@link CheckedLongSupplier} in a {@link LongSupplier} with a custom handler for checked exceptions.
<p>
Example:
<pre><code>
ResultSet rs = statement.executeQuery();

Stream.generate(Unchecked.longSupplier(
    () -> rs.getLong(1),
    e -> {
        throw new IllegalStateException(e);
    }
));
</code></pre>
jOOL/src/main/java/org/jooq/lambda/Unchecked.java