Either { public boolean isLeft() { return left != 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 testIsLeft() { assertEquals(false, ok.isLeft()); assertEquals(true, ko.isLeft()); }