public static <E extends Throwable> void withContextClassLoader(
            final ClassLoader cl, final ThrowingRunnable<E> r) throws E {

        try (TemporaryClassLoaderContext ignored = TemporaryClassLoaderContext.of(cl)) {
            r.run();
        }
    }
@Test
    void testRunWithContextClassLoaderRunnable() {
        final ClassLoader aPrioriContextClassLoader =
                Thread.currentThread().getContextClassLoader();

        try {
            final ClassLoader original = new URLClassLoader(new URL[0]);
            final ClassLoader temp = new URLClassLoader(new URL[0]);

            // set the original context class loader
            Thread.currentThread().setContextClassLoader(original);

            LambdaUtil.withContextClassLoader(
                            temp, () -> assertThat(Thread.currentThread().getContextClassLoader()))
                    .isSameAs(temp);

            // make sure the method restored the original context class loader
            assertThat(Thread.currentThread().getContextClassLoader()).isSameAs(original);
        } finally {
            Thread.currentThread().setContextClassLoader(aPrioriContextClassLoader);
        }
    }