@Override
    public boolean initMethod(PluginAnnotation pluginAnnotation) {
        Object plugin = pluginAnnotation.getPlugin();

        if (plugin == null) {
            // special case - static method - register callback
            if (Modifier.isStatic(pluginAnnotation.getMethod().getModifiers()))
                return registerClassLoaderInit(pluginAnnotation);
            else
                return true;
        } else {
            if (!Modifier.isStatic(pluginAnnotation.getMethod().getModifiers())) {
                ClassLoader appClassLoader = pluginManager.getPluginRegistry().getAppClassLoader(plugin);
                return invokeInitMethod(pluginAnnotation, plugin, appClassLoader);
            } else
                return true;
        }
    }
@Test
    public void testInitMethod() throws Exception {
        PluginManager pluginManager = PluginManager.getInstance();
        SimplePlugin simplePlugin = new SimplePlugin();

        // register the plugin
        pluginManager.getPluginRegistry().getRegisteredPlugins().put(SimplePlugin.class,
                Collections.<ClassLoader, Object>singletonMap(getClass().getClassLoader(), simplePlugin));

        InitHandler initHandler = new InitHandler(pluginManager);

        Method method = SimplePlugin.class.getMethod("initPlugin", PluginManager.class);
        PluginAnnotation<Init> pluginAnnotation = new PluginAnnotation<Init>(SimplePlugin.class,
                simplePlugin, method.getAnnotation(Init.class), method);
        assertTrue("Init successful",
                initHandler.initMethod(pluginAnnotation));
    }