@Override
    public PluginSharedInstance createSharedInstance(PluginTestContext context) {
        if (sharedClass == null) {
            return null;
        }

        final List<Path> libs = new ArrayList<>();
        libs.add(context.getTestClassLocation());
        libs.addAll(FileUtils.toPaths(context.getSharedLibList()));

        if (ArrayUtils.hasLength(sharedDependencies)) {
            final DependencyResolver resolver = getDependencyResolver(repositories);
            final Map<String, List<Artifact>> dependencyCases = resolver.resolveDependencySets(sharedDependencies);

            for (Map.Entry<String, List<Artifact>> dependencyCase : dependencyCases.entrySet()) {
                final String testId = dependencyCase.getKey();
                try {
                    final List<Artifact> artifactList = dependencyCase.getValue();
                    libs.addAll(resolveArtifactsAndDependencies(resolver, artifactList));
                } catch (DependencyResolutionException ex) {
                    logger.info(ex, "Failed to resolve artifacts and dependencies. dependency={}", dependencyCase);
                }
            }
        }

        PluginSharedInstanceFactory factory = new PluginSharedInstanceFactory();
        try {
            return factory.create(testClassName, sharedClass.getName(), libs);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
    }
We have referred OrderedThreadPoolExecutor ParentRunner of JUnit.

@author Jongho Moon
@author Taejin Koo
agent-module/plugins-test-module/plugins-test/src/main/java/com/navercorp/pinpoint/test/plugin/DefaultPluginTestSuite.java