public static Runnable withContextClassLoader(
            Runnable runnable, ClassLoader contextClassLoader) {
        return () -> runWithContextClassLoader(runnable::run, contextClassLoader);
    }
@Test
    void testRunnableWithContextClassLoader() throws Exception {
        final CompletableFuture<ClassLoader> contextClassLoader = new CompletableFuture<>();
        Runnable runnable =
                () -> contextClassLoader.complete(Thread.currentThread().getContextClassLoader());

        final Runnable wrappedRunnable =
                ClassLoadingUtils.withContextClassLoader(runnable, TEST_CLASS_LOADER);

        // the runnable should only be wrapped, not run immediately
        assertThat(contextClassLoader).isNotDone();

        wrappedRunnable.run();
        assertThat(contextClassLoader.get()).isSameAs(TEST_CLASS_LOADER);
    }