Example #1
0
 @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");
 }
Example #2
0
 @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");
 }