@Test
public void testMap() {

    final Result<String> success = Result.success("success");
    final Result<String> successMapped = success.map(String::toUpperCase);
    assertEquals("success maps to SUCCESS",
            "SUCCESS", successMapped.getOrDefault("success"));
    final Result<String> failure = Result.failure("failure");
    final Result<String> failureMapped = failure.map(String::toUpperCase);
    assertSame("failures have same exception",
            failure.getError().get(), failureMapped.getError().get());
}