@Override
    public void publish(Event event){
        Class<? extends Event> type = event.getClass();
        List<Object> handlers = eventHandlers.get(event.getClass());
        if(handlers == null){
            LOG.info("No event handlers declared for event " + type.getName());
            return;
        }
        for(Object handler : handlers){
            for(Method method : handler.getClass().getMethods())
            {
                if(method.isAnnotationPresent(EventHandler.class) &&
                        method.getParameterTypes().length == 1  &&
                        method.getParameterTypes()[0].equals(event.getClass())){
                    try {
                        method.invoke(handler, event);
                    } catch (IllegalAccessException e) {
                        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                        throw new RuntimeException(e);
                    } catch (InvocationTargetException e) {
                        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                        throw new RuntimeException(e);
                    }
                }
            }
        }
    }