Either implements Union2<L, R> { public static <L, R> Either<L, R> left(L value) { return new Left<>(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 leftEquals() { Either<EventA, EventB> left1 = Either.left(eventA); Either<EventA, EventB> left2 = Either.left(eventA); assertThat(left1).isEqualTo(left2); }
@Test public void joinLeft() { Either<EventA, EventB> left = Either.left(eventA); left.join(funcAA, funcBA); verify(funcAA).call(eventA); verifyNoMoreInteractions(funcBA); }
@Test public void continuedLeft() { Either<EventA, EventB> left = Either.left(eventA); left.continued(actionA, actionB); verify(actionA).call(eventA); verifyNoMoreInteractions(actionB); }