TODO: this is just a generated example
Added in version 1.0.0
Happy happy = new Happy("name");
HappyPath<Happy, Sad> happyPath = HappyPath.happyPath(happy);
HappyPath<String, Sad> mapped = happyPath.map(Happy::toString);
assertThat(mapped.getHappy()).isEqualTo("name");
Exception uncaught = new Exception("boom");
Mapping<Happy, String> mapping = happy -> {throw uncaught;};
HappyPath<Happy, Sad> happyPath = HappyPath.happyPath(new Happy());
HappyPath<String, Sad> mapped = happyPath.map(mapping);
assertThat(mapped.getTechnicalFailure()).isEqualTo(uncaught);
Sad sad = new Sad();
HappyPath<Happy, Sad> happyPath = HappyPath.sadPath(sad);
HappyPath<String, Sad> mapped = happyPath.map(Happy::toString);
assertThat(mapped.getSad()).isEqualTo(sad);
Exception technicalFailure = new Exception();
HappyPath<Happy, Sad> happyPath = HappyPath.technicalFailure(technicalFailure);
HappyPath<String, Sad> mapped = happyPath.map(Happy::toString);
assertThat(mapped.getTechnicalFailure()).isEqualTo(technicalFailure);