Either implements Union2<L, R> { public static <L, R> Either<L, R> right(R value) { return new Right<>(value); } Either(); static Either<L, R> left(L value); static Either<L, R> right(R value); abstract boolean isLeft(); abstract boolean isRight(); @Deprecated abstract void fold(Action1<L> left, Action1<R> right); @Deprecated abstract T fold(Func1<L, T> left, Func1<R, T> right);  }
@Test public void continuedRight() { Either<EventA, EventB> right = Either.right(eventB); right.continued(actionA, actionB); verify(actionB).call(eventB); verifyNoMoreInteractions(actionA); }
@Test public void rightEquals() { Either<EventA, EventB> right1 = Either.right(eventB); Either<EventA, EventB> right2 = Either.right(eventB); assertThat(right1).isEqualTo(right2); }
@Test public void joinRight() { Either<EventA, EventB> right = Either.right(eventB); right.join(funcAB, funcBB); verify(funcBB).call(eventB); verifyNoMoreInteractions(funcAB); }