consensus-core/src/test/java/com/mboysan/consensus/util/MultiThreadExecutor.java
/**
     * Runs the <tt>runnable</tt> passed with the {@link #executor}. Catches any exceptions caught during the execution
     * of the <tt>runnable</tt>.
     * @param runnable the runnable to handle and report any ee.ut.jbizur.exceptions caught when running it.
     */
Runs the runnable passed with the  #executor. Catches any exceptions caught during the execution
of the runnable.
@param runnable the runnable to handle and report any ee.ut.jbizur.exceptions caught when running it.
Runs the runnable passed with the #executor . Catches any exceptions caught during the execution of the runnable . @param runnable the runnable to handle and report any ee . ut . jbizur . exceptions caught when running it .
public void execute(CheckedRunnable runnable) {
        futures.add(executor.submit(() -> {
            try {
                latch.await();
                runnable.run();
                return Optional.empty();
            } catch (Exception e) {
                return Optional.of(e);
            }
        }));
    }
public void execute ( CheckedRunnable runnable ) { futures . add ( executor . submit ( ( ) -> { try { latch . await ( ) ; runnable . run ( ) ; return Optional . empty ( ) ; } catch ( Exception e ) { return Optional . of ( e ) ; } } ) ) ; }
Runs the <tt>runnable</tt> passed with the {@link #executor}.
Runs the <tt > runnable< / tt > passed with the { @link #executor } .