EitherOf4 extends Either implements AValue<A>, BValue<B>, CValue<C>, DValue<D> { public static <A extends Message, B extends Message, C extends Message, D extends Message> EitherOf4<A, B, C, D> withA(A a) { checkNotNull(a); EitherOf4<A, B, C, D> result = new EitherOf4<>(a, 0); return result; } private  EitherOf4(Message value, int index); static EitherOf4<A, B, C, D> withA(A a); static EitherOf4<A, B, C, D> withB(B b); static EitherOf4<A, B, C, D> withC(C c); static EitherOf4<A, B, C, D> withD(D d); @Override A getA(); @Override B getB(); @Override C getC(); @Override D getD();  }
@Test @DisplayName("support equality") void supportEquality() { new EqualsTester().addEqualityGroup(eitherWithA, EitherOf4.withA(a)) .addEqualityGroup(eitherWithB) .addEqualityGroup(eitherWithC) .addEqualityGroup(eitherWithD) .testEquals(); }