// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/RecyclerViewAnimatingIdlingResource.java
// public class RecyclerViewAnimatingIdlingResource implements IdlingResource {
//     RecyclerView mRecyclerView;
//     ResourceCallback mCallback;
// 
//     public RecyclerViewAnimatingIdlingResource(RecyclerView recyclerView) {
//         mRecyclerView = recyclerView;
//     }
// 
//     @Override
//     public void registerIdleTransitionCallback(ResourceCallback callback) {
//         mCallback = callback;
//     }
// 
//     @Override
//     public boolean isIdleNow() {
//         if (!mRecyclerView.isAnimating()) {
//             if (mCallback != null) {
//                 mCallback.onTransitionToIdle();
//             }
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     @Override
//     public String getName() {
//         return "RecyclerViewAnimatingIdlingResource";
//     }
// }
// 
// Path: example/src/main/java/net/cattaka/android/adaptertoolbox/example/utils/FlashColorItemAnimator.java
// public enum FlashColor {
//     RED(Color.RED),
//     BLUE(Color.BLUE),
//     WHITE(Color.WHITE),
//     //
//     ;
//     public final int intValue;
// 
//     FlashColor(int intValue) {
//         this.intValue = intValue;
//     }
// }
// 
// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/TestUtils.java
// public static void waitForIdlingResource(IdlingResource idlingResource, int timeout) {
//     long l = SystemClock.elapsedRealtime();
//     do {
//         if (idlingResource.isIdleNow()) {
//             break;
//         }
//         SystemClock.sleep(100);
//     } while (SystemClock.elapsedRealtime() - l > timeout);
// }
// 
// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/TestUtils.java
// public static Matcher<View> withIdInRecyclerView(int id, int recyclerViewId, int position) {
//     return allOf(withId(id), isDescendantOfRecyclerView(recyclerViewId, position));
// }


import android.support.test.rule.ActivityTestRule;
import net.cattaka.android.adaptertoolbox.example.test.RecyclerViewAnimatingIdlingResource;
import net.cattaka.android.adaptertoolbox.example.utils.FlashColorItemAnimator.FlashColor;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.swipeDown;
import static android.support.test.espresso.action.ViewActions.swipeUp;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static net.cattaka.android.adaptertoolbox.example.test.TestUtils.waitForIdlingResource;
import static net.cattaka.android.adaptertoolbox.example.test.TestUtils.withIdInRecyclerView;
package net.cattaka.android.adaptertoolbox.example;





/**
 * Created by cattaka on 17/01/02.
 */
public class StringWithPayloadExampleActivityTest {
    @Rule
    public ActivityTestRule<StringWithPayloadExampleActivity> mActivityTestRule = new ActivityTestRule<>(StringWithPayloadExampleActivity.class, false, false);

    RecyclerViewAnimatingIdlingResource mRecyclerViewAnimatingIdlingResource;
    StringWithPayloadExampleActivity mActivity;

    @Before
    public void before() {
// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/RecyclerViewAnimatingIdlingResource.java
// public class RecyclerViewAnimatingIdlingResource implements IdlingResource {
//     RecyclerView mRecyclerView;
//     ResourceCallback mCallback;
// 
//     public RecyclerViewAnimatingIdlingResource(RecyclerView recyclerView) {
//         mRecyclerView = recyclerView;
//     }
// 
//     @Override
//     public void registerIdleTransitionCallback(ResourceCallback callback) {
//         mCallback = callback;
//     }
// 
//     @Override
//     public boolean isIdleNow() {
//         if (!mRecyclerView.isAnimating()) {
//             if (mCallback != null) {
//                 mCallback.onTransitionToIdle();
//             }
//             return true;
//         } else {
//             return false;
//         }
//     }
// 
//     @Override
//     public String getName() {
//         return "RecyclerViewAnimatingIdlingResource";
//     }
// }
// 
// Path: example/src/main/java/net/cattaka/android/adaptertoolbox/example/utils/FlashColorItemAnimator.java
// public enum FlashColor {
//     RED(Color.RED),
//     BLUE(Color.BLUE),
//     WHITE(Color.WHITE),
//     //
//     ;
//     public final int intValue;
// 
//     FlashColor(int intValue) {
//         this.intValue = intValue;
//     }
// }
// 
// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/TestUtils.java
// public static void waitForIdlingResource(IdlingResource idlingResource, int timeout) {
//     long l = SystemClock.elapsedRealtime();
//     do {
//         if (idlingResource.isIdleNow()) {
//             break;
//         }
//         SystemClock.sleep(100);
//     } while (SystemClock.elapsedRealtime() - l > timeout);
// }
// 
// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/test/TestUtils.java
// public static Matcher<View> withIdInRecyclerView(int id, int recyclerViewId, int position) {
//     return allOf(withId(id), isDescendantOfRecyclerView(recyclerViewId, position));
// }


// Path: example/src/androidTest/java/net/cattaka/android/adaptertoolbox/example/StringWithPayloadExampleActivityTest.java
import android.support.test.rule.ActivityTestRule;
import net.cattaka.android.adaptertoolbox.example.test.RecyclerViewAnimatingIdlingResource;
import net.cattaka.android.adaptertoolbox.example.utils.FlashColorItemAnimator.FlashColor;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import static android.support.test.espresso.Espresso.onView;
import static android.support.test.espresso.action.ViewActions.click;
import static android.support.test.espresso.action.ViewActions.swipeDown;
import static android.support.test.espresso.action.ViewActions.swipeUp;
import static android.support.test.espresso.assertion.ViewAssertions.matches;
import static android.support.test.espresso.matcher.ViewMatchers.withId;
import static android.support.test.espresso.matcher.ViewMatchers.withText;
import static net.cattaka.android.adaptertoolbox.example.test.TestUtils.waitForIdlingResource;
import static net.cattaka.android.adaptertoolbox.example.test.TestUtils.withIdInRecyclerView;

package net.cattaka.android.adaptertoolbox.example;





/**
 * Created by cattaka on 17/01/02.
 */
public class StringWithPayloadExampleActivityTest {
    @Rule
    public ActivityTestRule<StringWithPayloadExampleActivity> mActivityTestRule = new ActivityTestRule<>(StringWithPayloadExampleActivity.class, false, false);

    RecyclerViewAnimatingIdlingResource mRecyclerViewAnimatingIdlingResource;
    StringWithPayloadExampleActivity mActivity;

    @Before
    public void before() {
        mActivity = mActivityTestRule.launchActivity(null);