// Path: androidunittest/src/main/java/com/github/florent37/androidunittest/AndroidUnitTest.java
// public class AndroidUnitTest implements MethodRule {
// 
//     ControllerActivity controllerActivity;
//     ControllerFragment controllerFragment;
//     @Nullable ActivityController activityController;
//     private AndroidUnitTestAnnotations androidUnitTestAnnotations;
// 
//     protected AndroidUnitTest() {
//         androidUnitTestAnnotations = new AndroidUnitTestAnnotations(AndroidUnitTest.this);
//         controllerActivity = new ControllerActivity(this);
//         controllerFragment = new ControllerFragment(this);
//     }
// 
//     public static AndroidUnitTest rule() {
//         return new AndroidUnitTest();
//     }
// 
//     @Override
//     public Statement apply(final Statement base, FrameworkMethod method, final Object target) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 MockitoAnnotations.initMocks(target);
//                 androidUnitTestAnnotations.init(target);
//                 base.evaluate();
//                 Mockito.validateMockitoUsage();
//             }
//         };
//     }
// 
//     @Nullable
//     public ActivityController getActivityController() {
//         return activityController;
//     }
// 
//     public void setActivityController(@Nullable ActivityController activityController) {
//         this.activityController = activityController;
//     }
// 
//     public AndroidUnitTestAnnotations getAndroidUnitTestAnnotations() {
//         return androidUnitTestAnnotations;
//     }
// 
//     public ControllerActivity activity() {
//         return controllerActivity;
//     }
// 
//     public ControllerFragment fragment() {
//         return controllerFragment;
//     }
// 
// }


import android.content.Context;
import android.support.annotation.NonNull;
import com.github.florent37.androidunittest.AndroidUnitTest;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
package com.github.florent37.androidunittest.managers;




/**
 * Created by kevinleperf on 18/05/16.
 */
public abstract class AbstractAnnotationManager {
    private AndroidUnitTest mAndroidUnitTest;

    private AbstractAnnotationManager() {

    }

    public AbstractAnnotationManager(AndroidUnitTest parent) {
        this();

        mAndroidUnitTest = parent;
    }

    public final boolean canManage(@NonNull Field field) {
        return field.isAnnotationPresent(canManagerInternal());
    }

    @NonNull
    protected abstract Class<? extends Annotation> canManagerInternal();

    /**
     * Method called by the AndroidUnitTestAnnotations class
     * during the scan() method
     *
     * @param field the scanned field to manage internally
     */
    public abstract void scanned(@NonNull Field field);

    /**
     * Method called by the AndroidUnitTestAnnotations class
     * during the execute() method
     *
     * @param object  the object to be applied
     * @param context the current app context
     */
    public abstract void execute(@NonNull Object object,
                                 @NonNull Context context);

    @NonNull
// Path: androidunittest/src/main/java/com/github/florent37/androidunittest/AndroidUnitTest.java
// public class AndroidUnitTest implements MethodRule {
// 
//     ControllerActivity controllerActivity;
//     ControllerFragment controllerFragment;
//     @Nullable ActivityController activityController;
//     private AndroidUnitTestAnnotations androidUnitTestAnnotations;
// 
//     protected AndroidUnitTest() {
//         androidUnitTestAnnotations = new AndroidUnitTestAnnotations(AndroidUnitTest.this);
//         controllerActivity = new ControllerActivity(this);
//         controllerFragment = new ControllerFragment(this);
//     }
// 
//     public static AndroidUnitTest rule() {
//         return new AndroidUnitTest();
//     }
// 
//     @Override
//     public Statement apply(final Statement base, FrameworkMethod method, final Object target) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 MockitoAnnotations.initMocks(target);
//                 androidUnitTestAnnotations.init(target);
//                 base.evaluate();
//                 Mockito.validateMockitoUsage();
//             }
//         };
//     }
// 
//     @Nullable
//     public ActivityController getActivityController() {
//         return activityController;
//     }
// 
//     public void setActivityController(@Nullable ActivityController activityController) {
//         this.activityController = activityController;
//     }
// 
//     public AndroidUnitTestAnnotations getAndroidUnitTestAnnotations() {
//         return androidUnitTestAnnotations;
//     }
// 
//     public ControllerActivity activity() {
//         return controllerActivity;
//     }
// 
//     public ControllerFragment fragment() {
//         return controllerFragment;
//     }
// 
// }


// Path: androidunittest/src/main/java/com/github/florent37/androidunittest/managers/AbstractAnnotationManager.java
import android.content.Context;
import android.support.annotation.NonNull;
import com.github.florent37.androidunittest.AndroidUnitTest;
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

package com.github.florent37.androidunittest.managers;




/**
 * Created by kevinleperf on 18/05/16.
 */
public abstract class AbstractAnnotationManager {
    private AndroidUnitTest mAndroidUnitTest;

    private AbstractAnnotationManager() {

    }

    public AbstractAnnotationManager(AndroidUnitTest parent) {
        this();

        mAndroidUnitTest = parent;
    }

    public final boolean canManage(@NonNull Field field) {
        return field.isAnnotationPresent(canManagerInternal());
    }

    @NonNull
    protected abstract Class<? extends Annotation> canManagerInternal();

    /**
     * Method called by the AndroidUnitTestAnnotations class
     * during the scan() method
     *
     * @param field the scanned field to manage internally
     */
    public abstract void scanned(@NonNull Field field);

    /**
     * Method called by the AndroidUnitTestAnnotations class
     * during the execute() method
     *
     * @param object  the object to be applied
     * @param context the current app context
     */
    public abstract void execute(@NonNull Object object,
                                 @NonNull Context context);

    @NonNull
    protected AndroidUnitTest getAndroidUnitTest() {