Created
          July 13, 2023 06:52 
        
      - 
      
- 
        Save saswata-dutta/e9a82c0ddb10f7ee9fc974f6690ad18f to your computer and use it in GitHub Desktop. 
Revisions
- 
        saswata-dutta created this gist Jul 13, 2023 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ @FunctionalInterface interface ThrowingConsumer<T, E extends Exception> { void accept(T t) throws E; static <T> Consumer<T> unchecked(ThrowingConsumer<T, Exception> t) { return arg -> { try { t.accept(arg); } catch (Exception ex) { throw new RuntimeException(ex); } }; } } // threads.forEach(ThrowingConsumer.unchecked(Thread::join));