Add a `toString` method to `Either`
@@ -73,4 +73,9 @@ public B right() {
public Stream<B> stream() {
return Stream.of(right());
}
+
+ @Override
+ public String toString() {
+ return "[Either(" + (isLeft() ? "left" : "right") + "): " + (isLeft() ? left() : right()) + "]";
+ }
}
