### Question:
Eithers { public static <S, T> Predicate<? super Either<S, T>> isRight() { return new Predicate<Either<S, T>>() { @Override public boolean evaluate(Either<S, T> either) { return either.isRight(); } }; } private  Eithers(); static Iterable<T> rights(Iterable<Either<S, T>> eithers); static Iterable<S> lefts(Iterable<Either<S, T>> eithers); static Mapper<? super Either<S, T>, T> toRight(); static Mapper<? super Either<S, T>, S> toLeft(); static Predicate<? super Either<S, T>> isRight(); static Predicate<? super Either<S, T>> isLeft();  }### Answer:
@Test public void shouldReturnAPredicateThatReturnsTrueIfEitherIsRight() throws Exception { Either<String, Integer> either = Either.right(100); Predicate<? super Either<String, Integer>> predicate = Eithers.isRight(); Boolean isLeft = predicate.evaluate(either); assertThat(isLeft, is(true)); }
@Test public void shouldReturnAPredicateThatReturnsFalseIfEitherIsLeft() throws Exception { Either<String, Integer> either = Either.left("left"); Predicate<? super Either<String, Integer>> predicate = Eithers.isRight(); Boolean isLeft = predicate.evaluate(either); assertThat(isLeft, is(false)); }