// Path: library/src/main/java/com/alexvasilkov/events/EventsException.java
// public class EventsException extends RuntimeException {
// 
//     public EventsException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public EventsException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
// }
// 
// Path: library/src/main/java/com/alexvasilkov/events/cache/CacheProvider.java
// public interface CacheProvider {
// 
//     EventResult loadFromCache(@NonNull Event event) throws Exception;
// 
//     void saveToCache(@NonNull Event event, EventResult result) throws Exception;
// 
// }


import android.support.annotation.NonNull;
import android.util.Log;
import com.alexvasilkov.events.Events.Background;
import com.alexvasilkov.events.Events.Cache;
import com.alexvasilkov.events.Events.Failure;
import com.alexvasilkov.events.Events.Result;
import com.alexvasilkov.events.Events.Status;
import com.alexvasilkov.events.Events.Subscribe;
import com.alexvasilkov.events.EventsException;
import com.alexvasilkov.events.cache.CacheProvider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
            }
        }

        return methods;
    }

    @NonNull
    private static List<EventMethod> collectMethodsRecursively(Class<?> clazz,
            Map<Class<?>, List<EventMethod>> cache, boolean statics) {

        List<EventMethod> list = cache.get(clazz);

        if (list != null) {
            return list;
        } else if (clazz.getName().startsWith("android.") || clazz.getName().startsWith("java.")) {
            // Ignoring system classes
            return Collections.emptyList();
        } else {
            list = new ArrayList<>();

            // First adding all methods from super classes
            if (clazz.getSuperclass() != null) {
                List<EventMethod> superList = collectMethodsRecursively(
                        clazz.getSuperclass(), cache, statics);
                list.addAll(superList);
            }

            // Now collecting methods from current class and store result in cache
            collectMethods(clazz, list, statics);
            cache.put(clazz, list);
// Path: library/src/main/java/com/alexvasilkov/events/EventsException.java
// public class EventsException extends RuntimeException {
// 
//     public EventsException(String detailMessage) {
//         super(detailMessage);
//     }
// 
//     public EventsException(String detailMessage, Throwable throwable) {
//         super(detailMessage, throwable);
//     }
// 
// }
// 
// Path: library/src/main/java/com/alexvasilkov/events/cache/CacheProvider.java
// public interface CacheProvider {
// 
//     EventResult loadFromCache(@NonNull Event event) throws Exception;
// 
//     void saveToCache(@NonNull Event event, EventResult result) throws Exception;
// 
// }


// Path: library/src/main/java/com/alexvasilkov/events/internal/EventMethodsHelper.java
import android.support.annotation.NonNull;
import android.util.Log;
import com.alexvasilkov.events.Events.Background;
import com.alexvasilkov.events.Events.Cache;
import com.alexvasilkov.events.Events.Failure;
import com.alexvasilkov.events.Events.Result;
import com.alexvasilkov.events.Events.Status;
import com.alexvasilkov.events.Events.Subscribe;
import com.alexvasilkov.events.EventsException;
import com.alexvasilkov.events.cache.CacheProvider;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

            }
        }

        return methods;
    }

    @NonNull
    private static List<EventMethod> collectMethodsRecursively(Class<?> clazz,
            Map<Class<?>, List<EventMethod>> cache, boolean statics) {

        List<EventMethod> list = cache.get(clazz);

        if (list != null) {
            return list;
        } else if (clazz.getName().startsWith("android.") || clazz.getName().startsWith("java.")) {
            // Ignoring system classes
            return Collections.emptyList();
        } else {
            list = new ArrayList<>();

            // First adding all methods from super classes
            if (clazz.getSuperclass() != null) {
                List<EventMethod> superList = collectMethodsRecursively(
                        clazz.getSuperclass(), cache, statics);
                list.addAll(superList);
            }

            // Now collecting methods from current class and store result in cache
            collectMethods(clazz, list, statics);
            cache.put(clazz, list);
            return list;