@Override
    public void close() {
        super.close();
        // close other classloader in the list
        for (FlinkUserCodeClassLoader classLoader : originClassLoaders) {
            try {
                classLoader.close();
            } catch (IOException e) {
                LOG.error("Failed to close the origin classloader.", e);
            }
        }

        originClassLoaders.clear();
    }
@Test
    public void testClassLoadingByAddURL() throws Exception {
        Configuration configuration = new Configuration();
        final ClientWrapperClassLoader classLoader =
                new ClientWrapperClassLoader(
                        ClientClassloaderUtil.buildUserClassLoader(
                                Collections.emptyList(),
                                getClass().getClassLoader(),
                                configuration),
                        configuration);

        // test class loader before add jar url to ClassLoader
        assertClassNotFoundException(GENERATED_LOWER_UDF_CLASS, classLoader);

        // add jar url to ClassLoader
        classLoader.addURL(userJar.toURI().toURL());

        assertEquals(1, classLoader.getURLs().length);

        final Class<?> clazz1 = Class.forName(GENERATED_LOWER_UDF_CLASS, false, classLoader);
        final Class<?> clazz2 = Class.forName(GENERATED_LOWER_UDF_CLASS, false, classLoader);

        assertEquals(clazz1, clazz2);

        classLoader.close();
    }