@Test @DisplayName("prohibit obtaining A when B is set") void notGetAForB() { assertThrows(IllegalStateException.class, () -> eitherWithB.getA()); }
@Override public A getA() { return get(this, 0); }
EitherOf2 extends Either implements AValue<A>, BValue<B> { @Override public A getA() { return get(this, 0); } }
EitherOf2 extends Either implements AValue<A>, BValue<B> { @Override public A getA() { return get(this, 0); } private  EitherOf2(Message value, int index); }
EitherOf2 extends Either implements AValue<A>, BValue<B> { @Override public A getA() { return get(this, 0); } private  EitherOf2(Message value, int index); static EitherOf2<A, B> withA(A a); static EitherOf2<A, B> withB(B b); @Override A getA(); @Override B getB(); }
EitherOf2 extends Either implements AValue<A>, BValue<B> { @Override public A getA() { return get(this, 0); } private  EitherOf2(Message value, int index); static EitherOf2<A, B> withA(A a); static EitherOf2<A, B> withB(B b); @Override A getA(); @Override B getB();  }