// Path: app/src/androidTest/java/com/starter/util/DeviceAnimationTestRule.java
// public final class DeviceAnimationTestRule implements TestRule {
//     private static final String ANIMATION_PERMISSION = "android.permission.SET_ANIMATION_SCALE";
//     private static final float DISABLED = 0.0f;
//     private static final float DEFAULT = 1.0f;
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 disableAnimations();
//                 try {
//                     base.evaluate();
//                 } finally {
//                     enableAnimations();
//                 }
//             }
//         };
//     }
// 
//     private void disableAnimations() throws Exception {
//         Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
// 
//         UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
//             .executeShellCommand("pm grant " + InstrumentationRegistry.getInstrumentation()
//                 .getTargetContext()
//                 .getPackageName() + " android.permission.SET_ANIMATION_SCALE");
// 
//         Context context = instrumentation.getContext();
// 
//         int permStatus = context.checkCallingOrSelfPermission(ANIMATION_PERMISSION);
//         if (permStatus == PackageManager.PERMISSION_GRANTED) {
//             setSystemAnimationsScale(DISABLED);
//         }
//     }
// 
//     private void enableAnimations() throws Exception {
//         Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
//         Context context = instrumentation.getContext();
// 
//         int permStatus = context.checkCallingOrSelfPermission(ANIMATION_PERMISSION);
//         if (permStatus == PackageManager.PERMISSION_GRANTED) {
//             setSystemAnimationsScale(DEFAULT);
//         }
//     }
// 
//     private void setSystemAnimationsScale(float animationScale) throws Exception {
//         Class<?> windowManagerStubClazz = Class.forName("android.view.IWindowManager$Stub");
//         Method asInterface = windowManagerStubClazz.getDeclaredMethod("asInterface", IBinder.class);
//         Class<?> serviceManagerClazz = Class.forName("android.os.ServiceManager");
//         Method getService = serviceManagerClazz.getDeclaredMethod("getService", String.class);
//         Class<?> windowManagerClazz = Class.forName("android.view.IWindowManager");
//         Method setAnimationScales =
//             windowManagerClazz.getDeclaredMethod("setAnimationScales", float[].class);
//         Method getAnimationScales = windowManagerClazz.getDeclaredMethod("getAnimationScales");
// 
//         IBinder windowManagerBinder = (IBinder) getService.invoke(null, "window");
//         Object windowManagerObj = asInterface.invoke(null, windowManagerBinder);
//         float[] currentScales = (float[]) getAnimationScales.invoke(windowManagerObj);
//         for (int i = 0; i < currentScales.length; i++) {
//             currentScales[i] = animationScale;
//         }
//         setAnimationScales.invoke(windowManagerObj, new Object[] { currentScales });
//     }
// }


import android.support.test.rule.ActivityTestRule;
import com.starter.R;
import com.starter.util.DeviceAnimationTestRule;
import io.appflate.restmock.RESTMockServer;
import io.appflate.restmock.RequestsVerifier;
import okhttp3.mockwebserver.MockResponse;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static io.appflate.restmock.utils.RequestMatchers.pathContains;
import static org.hamcrest.CoreMatchers.not;
package com.starter.ui.contributors;



public class ContributorsActivityTest {
    private static final String CONTRIBUTORS_JSON = "contributors.json";
    private static final String EMPTY_JSON = "empty_array.json";
    private static final String CONTRIBUTORS_ENDPOINT = "contributors";

// Path: app/src/androidTest/java/com/starter/util/DeviceAnimationTestRule.java
// public final class DeviceAnimationTestRule implements TestRule {
//     private static final String ANIMATION_PERMISSION = "android.permission.SET_ANIMATION_SCALE";
//     private static final float DISABLED = 0.0f;
//     private static final float DEFAULT = 1.0f;
// 
//     @Override
//     public Statement apply(final Statement base, Description description) {
//         return new Statement() {
//             @Override
//             public void evaluate() throws Throwable {
//                 disableAnimations();
//                 try {
//                     base.evaluate();
//                 } finally {
//                     enableAnimations();
//                 }
//             }
//         };
//     }
// 
//     private void disableAnimations() throws Exception {
//         Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
// 
//         UiDevice.getInstance(InstrumentationRegistry.getInstrumentation())
//             .executeShellCommand("pm grant " + InstrumentationRegistry.getInstrumentation()
//                 .getTargetContext()
//                 .getPackageName() + " android.permission.SET_ANIMATION_SCALE");
// 
//         Context context = instrumentation.getContext();
// 
//         int permStatus = context.checkCallingOrSelfPermission(ANIMATION_PERMISSION);
//         if (permStatus == PackageManager.PERMISSION_GRANTED) {
//             setSystemAnimationsScale(DISABLED);
//         }
//     }
// 
//     private void enableAnimations() throws Exception {
//         Instrumentation instrumentation = InstrumentationRegistry.getInstrumentation();
//         Context context = instrumentation.getContext();
// 
//         int permStatus = context.checkCallingOrSelfPermission(ANIMATION_PERMISSION);
//         if (permStatus == PackageManager.PERMISSION_GRANTED) {
//             setSystemAnimationsScale(DEFAULT);
//         }
//     }
// 
//     private void setSystemAnimationsScale(float animationScale) throws Exception {
//         Class<?> windowManagerStubClazz = Class.forName("android.view.IWindowManager$Stub");
//         Method asInterface = windowManagerStubClazz.getDeclaredMethod("asInterface", IBinder.class);
//         Class<?> serviceManagerClazz = Class.forName("android.os.ServiceManager");
//         Method getService = serviceManagerClazz.getDeclaredMethod("getService", String.class);
//         Class<?> windowManagerClazz = Class.forName("android.view.IWindowManager");
//         Method setAnimationScales =
//             windowManagerClazz.getDeclaredMethod("setAnimationScales", float[].class);
//         Method getAnimationScales = windowManagerClazz.getDeclaredMethod("getAnimationScales");
// 
//         IBinder windowManagerBinder = (IBinder) getService.invoke(null, "window");
//         Object windowManagerObj = asInterface.invoke(null, windowManagerBinder);
//         float[] currentScales = (float[]) getAnimationScales.invoke(windowManagerObj);
//         for (int i = 0; i < currentScales.length; i++) {
//             currentScales[i] = animationScale;
//         }
//         setAnimationScales.invoke(windowManagerObj, new Object[] { currentScales });
//     }
// }


// Path: app/src/androidTest/java/com/starter/ui/contributors/ContributorsActivityTest.java
import android.support.test.rule.ActivityTestRule;
import com.starter.R;
import com.starter.util.DeviceAnimationTestRule;
import io.appflate.restmock.RESTMockServer;
import io.appflate.restmock.RequestsVerifier;
import okhttp3.mockwebserver.MockResponse;
import org.junit.Before;
import org.junit.ClassRule;
import org.junit.Rule;
import org.junit.Test;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static io.appflate.restmock.utils.RequestMatchers.pathContains;
import static org.hamcrest.CoreMatchers.not;

package com.starter.ui.contributors;



public class ContributorsActivityTest {
    private static final String CONTRIBUTORS_JSON = "contributors.json";
    private static final String EMPTY_JSON = "empty_array.json";
    private static final String CONTRIBUTORS_ENDPOINT = "contributors";

    @ClassRule static public DeviceAnimationTestRule deviceAnimationTestRule =