private static void process(@Nonnull final NiftyEventSubscriber annotation, final Object obj, @Nonnull final Method method, final boolean add) { String id = annotation.id(); String pattern = annotation.pattern(); ensureNotNull(id, pattern); ensureMethodParamCount(method.getParameterTypes()); EventService eventService = getEventService(); Class<?> eventClass = method.getParameterTypes()[1]; if (isSet(id)) { idProcess(obj, method, add, id, eventClass, eventService); } else { patternProcess(obj, method, add, pattern, eventClass, eventService); } }