### Question:
LambdaUtils { public static RuntimeException getPropagation(Throwable throwable){ Function<? extends Throwable, RuntimeException> function = mappersCache.computeIfAbsent(throwable.getClass(), clazz -> { Class<?> currentClazz = clazz; do { Function<? extends Throwable, RuntimeException> mapper = mappers.get(currentClazz); if (mapper != null) { return mapper; } currentClazz = currentClazz.getSuperclass(); } while (currentClazz != null); return RuntimeException::new; }); @SuppressWarnings("unchecked") Function<Throwable, RuntimeException> function1 = (Function<Throwable, RuntimeException>) function; return function1.apply(throwable); } private  LambdaUtils(); static void registerMapper(Class<T> clazz, Function<T, RuntimeException> function); static Supplier<T> unchecked(Callable<T> func); static Supplier<T> uncheckedS(Callable<T> func); static Function<T, R> unchecked(ThrowingFunction<T, R> func); static Function<T, R> uncheckedF(ThrowingFunction<T, R> func); static BiFunction<T, U, R> unchecked(ThrowingBiFunction<T, U, R> func); static BiFunction<T, U, R> uncheckedBF(ThrowingBiFunction<T, U, R> func); static Consumer<T> unchecked(ThrowingConsumer<T> func); static Consumer<T> uncheckedC(ThrowingConsumer<T> func); static Predicate<T> uncheckedP(ThrowingPredicate<T> func); static RuntimeException propagate(Throwable throwable); static RuntimeException getPropagation(Throwable throwable);  }### Answer:
@Test(groups = "unit") public void propagation() throws Exception { assertEquals(getPropagation(new IIOException("")).getClass(), RuntimeException.class); assertEquals(getPropagation(new IndexOutOfBoundsException()).getClass(), IndexOutOfBoundsException.class); assertEquals(getPropagation(new InvocationTargetException(null)).getClass(), RuntimeException.class); assertEquals(getPropagation(new InvocationTargetException(new IndexOutOfBoundsException())).getClass(), IndexOutOfBoundsException.class); assertEquals(getPropagation(new ExecutionException(null)).getClass(), RuntimeException.class); assertEquals(getPropagation(new ExecutionException(new IndexOutOfBoundsException())).getClass(), IndexOutOfBoundsException.class); }
@Test(groups = "unit") public void thriftExceptions() throws Exception { assertEquals(getPropagation(new TestEx()).getClass(), ThriftApplicationException.class); assertEquals(getPropagation(new TException()).getClass(), ThriftConnectionException.class); assertEquals( getPropagation(new TProtocolException("Test")).getClass(), ThriftConnectionException.class ); assertEquals( getPropagation(new TProtocolException(TProtocolException.SIZE_LIMIT, "Test")).getClass(), ThriftTooLongMessageException.class ); assertEquals( getPropagation(new TTransportException("Test")).getClass(), ThriftConnectionException.class ); assertEquals( getPropagation(new TTransportException("Frame size (" + 100 + ") larger than max length (" + 10 + ")!")).getClass(), ThriftTooLongMessageException.class ); }