    @Test
    public void testDependenciesSortList() {


        PluginManager manager = PluginManager.getInstance();

        try {
            //     private Collection<? extends Plugin> sortDependencies(Collection<? extends Plugin> plugins) {
            Method sort = manager.getClass().getDeclaredMethod("sortDependencies", Iterable.class);
            sort.setAccessible(true);

            List<Plugin> plugins = new ArrayList<>();
            plugins.add(new PluginA());
            plugins.add(new PluginB());
            plugins.add(new PluginC());
            plugins.add(new PluginD());
            plugins.add(new PluginE());
            plugins.add(new PluginF());
            plugins.add(new PluginG());

            //noinspection unchecked
            Collection<? extends Plugin> sortPlugins = (Collection<? extends Plugin>) sort.invoke(manager, plugins);
            StringBuilder actual = new StringBuilder();
            for (Plugin plugin : sortPlugins) {
                actual.append(plugin.getPluginInfo().getId());
            }
            TestCase.assertEquals("GBCDFEA", actual.toString());
        }
        catch (NoSuchMethodException e) {
            e.printStackTrace();
            TestCase.fail();
        }
        catch (InvocationTargetException e) {
            e.printStackTrace();
            TestCase.fail();
        }
        catch (IllegalAccessException e) {
            e.printStackTrace();
            TestCase.fail();
        }
    }