### Question:
EitherMatchers { public static <S, T> Matcher<? super Either<S, T>> left() { return new EitherAnyLeftMatcher<S, T>(); }  static Matcher<? super Either<S, T>> left(); static Matcher<? super Either<S, T>> left(S leftValue); static Matcher<? super Either<S, T>> leftOver(Class<S> leftClass, Class<T> rightClass); static Matcher<? super Either<S, T>> leftOverValueAndType(S leftValue, Class<T> rightClass); static Matcher<? super Either<S, T>> right(); static Matcher<? super Either<S, T>> right(T rightValue); static Matcher<? super Either<S, T>> rightOver(Class<S> leftClass, Class<T> rightClass); static Matcher<? super Either<S, T>> rightOverTypeAndValue(Class<S> leftClass, T rightValue);  }### Answer:
@Test public void shouldMatchWhenLeftMatcherEvaluatesEitherWhichIsALeft() throws Exception { Either<String, Integer> either = Either.left("value"); Matcher<? super Either<String, Integer>> matcher = left(); assertThat(matcher, successfullyMatches(either)); }
@Test public void shouldProvideAdequateDescriptionWhenLeftIsAskedToDescribeItself() throws Exception { Matcher<? super Either<String, Integer>> matcher = left(); StringDescription description = new StringDescription(); matcher.describeTo(description); assertThat(description.toString(), is("Either to be Left.")); }
@Test public void shouldMatchWhenLeftMatcherEvaluatesEitherWhichIsALeftOverTheSpecificValue() throws Exception { Either<String, Integer> either = Either.left("value"); Matcher<? super Either<String, Integer>> matcher = left("value"); assertThat(matcher, successfullyMatches(either)); }
@Test public void shouldMatchWhenLeftMatcherEvaluatesEitherWhichIsALeftOverNullAndExpectedIsNull() throws Exception { Either<String, Integer> either = Either.left(null); Matcher<? super Either<String, Integer>> matcher = left(null); assertThat(matcher, successfullyMatches(either)); }
@Test public void shouldMismatchWithMessageWhenLeftMatcherEvaluatesEitherWhichIsALeftOverADifferentValue() throws Exception { Either<String, Integer> either = Either.left("actual value"); Matcher<? super Either<String, Integer>> matcher = left("expected value"); assertThat(matcher, mismatchesSampleWithMessage(either, "got Left with value: \"actual value\"")); }
@Test public void shouldMismatchWithMessageWhenLeftMatcherEvaluatesEitherWhichIsLeftOverAValueOtherThanNullButNullExpected() throws Exception { Either<String, Integer> either = Either.left("actual value"); Matcher<? super Either<String, Integer>> matcher = left(null); assertThat(matcher, mismatchesSampleWithMessage(either, "got Left with value: \"actual value\"")); }
@Test public void shouldMismatchWithMessageWhenLeftMatcherEvaluatesEitherWhichIsALeftOverNull() throws Exception { Either<String, Integer> either = Either.left(null); Matcher<? super Either<String, Integer>> matcher = left("expected value"); assertThat(matcher, mismatchesSampleWithMessage(either, "got Left with value: null")); }
@Test public void shouldProvideAdequateDescriptionWhenLeftWithSpecificValueIsAskedToDescribeItself() throws Exception { Matcher<? super Either<String, Integer>> matcher = left("value"); StringDescription description = new StringDescription(); matcher.describeTo(description); assertThat(description.toString(), is("Either to be Left with value: \"value\"")); }