@Test void matchesShouldReturnFalseWhenBothOptionalsAreEmpty() { assertThat( OptionalUtils.matches( Optional.empty(), Optional.empty(), Integer::equals)) .isFalse(); }
public static <T, U> boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate) { return optional1.map(value1 -> optional2 .map(value2 -> biPredicate.test(value1, value2)) .orElse(false)) .orElse(false); }
OptionalUtils { public static <T, U> boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate) { return optional1.map(value1 -> optional2 .map(value2 -> biPredicate.test(value1, value2)) .orElse(false)) .orElse(false); } }
OptionalUtils { public static <T, U> boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate) { return optional1.map(value1 -> optional2 .map(value2 -> biPredicate.test(value1, value2)) .orElse(false)) .orElse(false); }  }
OptionalUtils { public static <T, U> boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate) { return optional1.map(value1 -> optional2 .map(value2 -> biPredicate.test(value1, value2)) .orElse(false)) .orElse(false); }  static Optional<T> executeIfEmpty(Optional<T> optional, Operation operation); static boolean containsDifferent(Optional<T> requestValue, T storeValue); static boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate); }
OptionalUtils { public static <T, U> boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate) { return optional1.map(value1 -> optional2 .map(value2 -> biPredicate.test(value1, value2)) .orElse(false)) .orElse(false); }  static Optional<T> executeIfEmpty(Optional<T> optional, Operation operation); static boolean containsDifferent(Optional<T> requestValue, T storeValue); static boolean matches(Optional<T> optional1, Optional<U> optional2, BiPredicate<T, U> biPredicate);  }