Either { public boolean isRight() { return right != null; } private  Either(L left, R right); L getLeft(); R getRight(); boolean isLeft(); boolean isRight(); static Either<L, R> left(L left); static Either<L, R> right(R right); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testIsRight() { assertEquals(true, ok.isRight()); assertEquals(false, ko.isRight()); }