@Test public void shouldConvertNonEmptyValueToMatchValue() { final Value<Integer> value = of(1); final String actual = value.match().when((Value<Integer> v) -> v.getOrElse(-1) == 1).then("ok").getOrElse("nok"); assertThat(actual).isEqualTo("ok"); }
@Test public void shouldConvertEmptyValueToMatchValue() { final Value<Integer> value = empty(); final String actual = value.match().when(Value<Integer>::isEmpty).then("ok").getOrElse("nok"); assertThat(actual).isEqualTo("ok"); }