class ClassLoaderContextUtils {

    /**
     * Store thread context classloader then use new classloader to invoke runnable,
     * finally reset thread context classloader.
     * @param runnable runnable to invoke
     * @param newClassloader classloader used to invoke runnable
     */
    public static void runWithTemporaryContextClassloader(Runnable runnable,
                                                          ClassLoader newClassloader) {
        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(newClassloader);
        try {
            runnable.run();
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    }

    /**
     * Store thread context classloader then use new classloader to invoke callable,
     * finally reset thread context classloader.
     * @param callable callable to invoke
     * @param newClassloader classloader used to invoke callable
     */
    public static <T> T callWithTemporaryContextClassloader(Callable<T> callable,
                                                            ClassLoader newClassloader) {<FILL_FUNCTION_BODY>}
}

        ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(newClassloader);
        try {
            return callable.call();
        } catch (Exception e) {
            throw new RuntimeException("Failed to invoke callable", e);
        } finally {
            Thread.currentThread().setContextClassLoader(oldClassLoader);
        }
    
<no_super_class>