Tries to run the given ThrowingRunnable and throws a RuntimeException in case it fails.
<p>
If the given ThrowingRunnable throws a RuntimeException that Exception is rethrown.

@param runnable A runnable which might throw a checked Exception.
189264
public static void run(final @Nonnull ThrowingRunnable runnable) {
    Objects.requireNonNull(runnable, "runnable must not be null");
    try {
      runnable.run();
    } catch (final RuntimeException exc) {
      throw exc;
    } catch (final Exception exc) {
      throw new RuntimeException(exc);
    }
  }
1192543
public RetryerBuilder<V> retryIfRuntimeException() {
        rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class));
        return this;
    }
818608
static Runnable composeWithExceptions(Runnable a, Runnable b) {
        return new Runnable() {
            @Override
            public void run() {
                try {
                    a.run();
                }
                catch (Throwable e1) {
                    try {
                        b.run();
                    }
                    catch (Throwable e2) {
                        try {
                            e1.addSuppressed(e2);
                        } catch (Throwable ignore) {}
                    }
                    throw e1;
                }
                b.run();
            }
        };
    }
1024945
public static <T> T handleExceptionAndThrowRuntimeEx(Logger log,
            Throwable throwable, String method, Object... params) {
        handleException(log, throwable, method, params);
        throw new RuntimeException(throwable);
    }
1331044
public void invoke(Runnable r) throws Exception {
        try {
            r.run();
            succeed();
        } catch (Exception e) {
            fail();
            throw e;
        }
    }
341332
public static <E extends Exception> Runnable sneaked(SneakyRunnable<E> runnable) {
    return () -> {
      @SuppressWarnings("unchecked")
      SneakyRunnable<RuntimeException> castedRunnable = (SneakyRunnable<RuntimeException>) runnable;
      castedRunnable.run();
    };
  }
1012020
public function setRunnable( $_runnable ) {
		if( self::runnableOk( $_runnable ) ) {
			$this->runnable = $_runnable;
		}
		else {
			throw new Exception( $this->getError( Thread::FUNCTION_NOT_CALLABLE ), Thread::FUNCTION_NOT_CALLABLE );
		}
	}
1151962
public static void throwIfUnchecked(Throwable t) {
    Preconditions.checkNotNull(t);
    if (t instanceof RuntimeException) {
      throw (RuntimeException) t;
    }
    if (t instanceof Error) {
      throw (Error) t;
    }
  }
1107271
@Override
  public void execute(Runnable runnable) {
    if (runnable == null) {
      throw new NullPointerException("runnable parameter is null");
    }

    if (!mWorkQueue.offer(runnable)) {
      throw new RejectedExecutionException(
          mName + " queue is full, size=" + mWorkQueue.size());
    }

    final int queueSize = mWorkQueue.size();
    final int maxSize = mMaxQueueSize.get();
    if ((queueSize > maxSize) && mMaxQueueSize.compareAndSet(maxSize, queueSize)) {
      FLog.v(TAG, "%s: max pending work in queue = %d", mName, queueSize);
    } // else, there was a race and another thread updated and logged the max queue size

    startWorkerIfNeeded();
  }
278019
protected void throwException() throws InterruptedException, IOException {

        if (this.exception instanceof IOException) {
            throw (IOException) this.exception;
        }
        if (this.exception instanceof InterruptedException) {
            throw (InterruptedException) this.exception;
        }
        if (this.exception instanceof RuntimeException) {
            throw (RuntimeException) this.exception;
        }
        throw new RuntimeException(this.exception);
    }
1109628
@SuppressWarnings({"PMD.AvoidCatchingThrowable","PMD.AvoidInstanceofChecksInCatchClause"})
    public static Runnable swallowExceptions(Runnable in)
    {
        return () -> {
            try {
                in.run();
            } catch (Error tt) {
                LOGGER.error("Error (will be rethrown)", tt);
                throw tt;
            } catch (Throwable t) {
                LOGGER.error("Uncaught exception swallowed", t);
                // Ignore the IDE warning - consider Lombok's SneakyThrows, which is an abomination but heavily used by heathens, whom I pray for.
                if (t instanceof InterruptedException) {
                    Thread.currentThread().interrupt();
                }
            }
        };
    }
558033
public static RuntimeException unchecked(final Throwable t) {
		if (t instanceof RuntimeException) {
			return (RuntimeException) t;
		} else {
			return new RuntimeException(t);
		}
	}
704793
public I run(RunnableWithException runnable) {
        try {
            runnable.run();
        } catch (Exception e) {
            sneakyThrow(e);
        }
        return getThis();
    }
451060
public void run(ExceptionalRunnable runnable) throws Exception {
		initStartTotal();
		long startInvokation = System.currentTimeMillis();
		runnable.run();
		invoked(System.currentTimeMillis() - startInvokation);
	}
994268
public static RuntimeException asRuntimeException(Exception e) {
        if (e instanceof RuntimeException) {
            return (RuntimeException) e;
        }
        return UnexpectedMethodInvocationException.triage(e);
    }
58069
public static Thread go(Runnable runnable) {
        Thread thread = daemonThreadFrom(runnable);
        thread.start();
        return thread;
    }
753946
public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) {

        final List<RuntimeException> actualExceptions = new ArrayList<>();
        int tries = 0;
        while (tries < maxTries) {
            try {
                runnable.run();
                return;
            } catch (final RuntimeException ex) {
                if (!Utils4J.expectedException(ex, expectedExceptions) && !Utils4J.expectedCause(ex, expectedExceptions)) {
                    throw ex;
                }
                actualExceptions.add(ex);
                tries++;
                Utils4J.sleep(sleepMillis);
            }
        }
        throw new IllegalStateException("Waited too long for execution without exception. Expected exceptions: " + expectedExceptions
                + ", Actual exceptions: " + actualExceptions);

    }