// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withAttr(@AttrRes final int attr, @ColorInt final int color) {
//   return new AttributeMatcher(attr, null, ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withAttrRes(@AttrRes final int attr, @ColorRes final int colorRes) {
//   return new AttributeMatcher(attr, null, ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorAccent(@ColorInt final int color) {
//   return new AttributeMatcher(R.attr.colorAccent, "colorAccent", ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorAccentRes(@ColorRes final int colorRes) {
//   return new AttributeMatcher(R.attr.colorAccent, "colorAccent", ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorButtonNormal(@ColorInt final int color) {
//   return new AttributeMatcher(R.attr.colorButtonNormal, "colorButtonNormal", ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorButtonNormalRes(@ColorRes final int colorRes) {
//   return new AttributeMatcher(R.attr.colorButtonNormal, "colorButtonNormal", ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/AttributeMatcherActivity.java
// static final int VIEW_ID = 1234;


import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.vanniktech.espresso.core.utils.test.R;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import static android.graphics.Color.BLUE;
import static android.graphics.Color.GREEN;
import static android.graphics.Color.RED;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withAttr;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withAttrRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorAccent;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorAccentRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorButtonNormal;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorButtonNormalRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcherActivity.VIEW_ID;
    onView(withId(VIEW_ID)).check(matches(withAttr(R.attr.colorError, "#ff0000")));
  }

  @Test public void withColorButtonNormalResMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormalRes(R.color.red)));
  }

  @Test public void withColorButtonNormalMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal(RED)));
  }

  @Test public void withColorButtonNormalStringMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal("#ff0000")));
  }

  @Test public void withColorButtonNormalResDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormalRes(R.color.green)));
  }

  @Test public void withColorButtonNormalDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal(GREEN)));
  }

  @Test public void withColorButtonNormalStringDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withAttr(@AttrRes final int attr, @ColorInt final int color) {
//   return new AttributeMatcher(attr, null, ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withAttrRes(@AttrRes final int attr, @ColorRes final int colorRes) {
//   return new AttributeMatcher(attr, null, ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorAccent(@ColorInt final int color) {
//   return new AttributeMatcher(R.attr.colorAccent, "colorAccent", ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorAccentRes(@ColorRes final int colorRes) {
//   return new AttributeMatcher(R.attr.colorAccent, "colorAccent", ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorButtonNormal(@ColorInt final int color) {
//   return new AttributeMatcher(R.attr.colorButtonNormal, "colorButtonNormal", ColorChecker.from(color));
// }
// 
// Path: espresso-core-utils/src/main/java/com/vanniktech/espresso/core/utils/AttributeMatcher.java
// @CheckResult public static AttributeMatcher withColorButtonNormalRes(@ColorRes final int colorRes) {
//   return new AttributeMatcher(R.attr.colorButtonNormal, "colorButtonNormal", ColorChecker.fromRes(colorRes));
// }
// 
// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/AttributeMatcherActivity.java
// static final int VIEW_ID = 1234;


// Path: espresso-core-utils/src/androidTest/java/com/vanniktech/espresso/core/utils/AttributeMatcherTest.java
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.rule.ActivityTestRule;
import com.vanniktech.espresso.core.utils.test.R;
import junit.framework.AssertionFailedError;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import static android.graphics.Color.BLUE;
import static android.graphics.Color.GREEN;
import static android.graphics.Color.RED;
import static androidx.test.espresso.Espresso.onView;
import static androidx.test.espresso.assertion.ViewAssertions.matches;
import static androidx.test.espresso.matcher.ViewMatchers.withId;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withAttr;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withAttrRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorAccent;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorAccentRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorButtonNormal;
import static com.vanniktech.espresso.core.utils.AttributeMatcher.withColorButtonNormalRes;
import static com.vanniktech.espresso.core.utils.AttributeMatcherActivity.VIEW_ID;

    onView(withId(VIEW_ID)).check(matches(withAttr(R.attr.colorError, "#ff0000")));
  }

  @Test public void withColorButtonNormalResMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormalRes(R.color.red)));
  }

  @Test public void withColorButtonNormalMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal(RED)));
  }

  @Test public void withColorButtonNormalStringMatches() {
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal("#ff0000")));
  }

  @Test public void withColorButtonNormalResDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormalRes(R.color.green)));
  }

  @Test public void withColorButtonNormalDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal(GREEN)));
  }

  @Test public void withColorButtonNormalStringDoesNotMatch() {
    expectedException.expect(AssertionFailedError.class);
    expectedException.expectMessage("'with colorButtonNormal: ' doesn't match the selected view.");
    onView(withId(VIEW_ID)).check(matches(withColorButtonNormal("#00ff00")));