@Test
public void testFold() {

  Either<String, Integer> a = left("a");
  assertEquals("a", a.fold(new Either.Match<String, Integer, String>() {
    @Override
    public String left(String s) {
      return s;
    }
    @Override
    public String right(Integer integer) {
      return integer.toString();
    }
  }));
  Either<String, Integer> b = right(1);
  assertEquals("1", b.fold(new Either.Match<String, Integer, String>() {
    @Override
    public String left(String s) {
      return s;
    }
    @Override
    public String right(Integer integer) {
      return integer.toString();
    }
  }));
}