// Path: src/main/java/org/pdfsam/eventstudio/util/RequireUtils.java
// public static void requireNotNull(Object victim) {
//     if (victim == null) {
//         throw new IllegalArgumentException("The input object cannot be null");
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/util/StringUtils.java
// public static boolean isBlank(String input) {
//     return input == null || input.trim().length() <= 0;
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/EventStudioException.java
// public class EventStudioException extends RuntimeException {
// 
//     public EventStudioException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EventStudioException(String message) {
//         super(message);
//     }
// 
//     public EventStudioException(Throwable cause) {
//         super(cause);
//     }
// 
// }


import org.pdfsam.eventstudio.annotation.EventListener;
import org.pdfsam.eventstudio.annotation.EventStation;
import org.pdfsam.eventstudio.exception.EventStudioException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.pdfsam.eventstudio.util.RequireUtils.requireNotNull;
import static org.pdfsam.eventstudio.util.StringUtils.isBlank;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
        String station = getStationNameFromFieldIfAny(bean);
        ReflectiveMetadata metadata = new ReflectiveMetadata();
        for (Method method : getMethods(bean)) {
            if (isBlank(station)) {
                station = getStationNameIfAnnotated(method, bean);
            }
            addIfAnnotated(metadata, method);
        }
        metadata.station = station;
        return metadata;
    }

    /**
     * @return a list containing all the public methods (inherited and not) and all the private, package and protected (not inherited) methods of the given bean
     */
    private static List<Method> getMethods(Object bean) {
        List<Method> methods = new LinkedList<>(Arrays.asList(bean.getClass().getMethods()));
        for (Method method : bean.getClass().getDeclaredMethods()) {
            if (!Modifier.isPublic(method.getModifiers())) {
                methods.add(method);
            }
        }
        return methods;
    }

    private static void addIfAnnotated(ReflectiveMetadata metadata, Method method) {
        EventListener listenerAnnotation = method.getAnnotation(EventListener.class);
        if (listenerAnnotation != null) {
            Class<?>[] parameterTypes = method.getParameterTypes();
            if (parameterTypes.length != 1) {
// Path: src/main/java/org/pdfsam/eventstudio/util/RequireUtils.java
// public static void requireNotNull(Object victim) {
//     if (victim == null) {
//         throw new IllegalArgumentException("The input object cannot be null");
//     }
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/util/StringUtils.java
// public static boolean isBlank(String input) {
//     return input == null || input.trim().length() <= 0;
// }
// 
// Path: src/main/java/org/pdfsam/eventstudio/exception/EventStudioException.java
// public class EventStudioException extends RuntimeException {
// 
//     public EventStudioException(String message, Throwable cause) {
//         super(message, cause);
//     }
// 
//     public EventStudioException(String message) {
//         super(message);
//     }
// 
//     public EventStudioException(Throwable cause) {
//         super(cause);
//     }
// 
// }


// Path: src/main/java/org/pdfsam/eventstudio/Annotations.java
import org.pdfsam.eventstudio.annotation.EventListener;
import org.pdfsam.eventstudio.annotation.EventStation;
import org.pdfsam.eventstudio.exception.EventStudioException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.pdfsam.eventstudio.util.RequireUtils.requireNotNull;
import static org.pdfsam.eventstudio.util.StringUtils.isBlank;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

        String station = getStationNameFromFieldIfAny(bean);
        ReflectiveMetadata metadata = new ReflectiveMetadata();
        for (Method method : getMethods(bean)) {
            if (isBlank(station)) {
                station = getStationNameIfAnnotated(method, bean);
            }
            addIfAnnotated(metadata, method);
        }
        metadata.station = station;
        return metadata;
    }

    /**
     * @return a list containing all the public methods (inherited and not) and all the private, package and protected (not inherited) methods of the given bean
     */
    private static List<Method> getMethods(Object bean) {
        List<Method> methods = new LinkedList<>(Arrays.asList(bean.getClass().getMethods()));
        for (Method method : bean.getClass().getDeclaredMethods()) {
            if (!Modifier.isPublic(method.getModifiers())) {
                methods.add(method);
            }
        }
        return methods;
    }

    private static void addIfAnnotated(ReflectiveMetadata metadata, Method method) {
        EventListener listenerAnnotation = method.getAnnotation(EventListener.class);
        if (listenerAnnotation != null) {
            Class<?>[] parameterTypes = method.getParameterTypes();
            if (parameterTypes.length != 1) {
                throw new EventStudioException(