Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. public interface ThrowingRunnable<E extends Exception> {
  2.  
  3. static Runnable throwingRunnableWrapper(final ThrowingRunnable<Exception> throwingRunnable) {
  4.  
  5. return () -> {
  6. try {
  7. throwingRunnable.run();
  8. } catch (final Exception ex) {
  9. throw new RuntimeException(ex);
  10. }
  11. };
  12. }
  13.  
  14. void run() throws E;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement