OptionalProperty extends AbstractProperty<Optional<T>> implements ObservableOptional<T> { @Override @NotNull public final T getValueOr(@NotNull T defaultValue) { Optional<T> opt = get(); return opt.orElse(defaultValue); }  final void setValue(@NotNull T value); final void clear(); final void setNullableValue(@Nullable T value); @NotNull @Override final ObservableBool isPresent(); @Override @NotNull final T getValue(); @Override @NotNull final T getValueOr(@NotNull T defaultValue); @Override @Nullable final T getValueOrNull();  }
@Test public void testGetValueOr() { OptionalProperty<String> optStringValue = OptionalValueProperty.absent(); assertThat(optStringValue.getValueOr("Default")).isEqualTo("Default"); assertThat(optStringValue.get().isPresent()).isFalse(); optStringValue.setValue("Not Default"); assertThat(optStringValue.getValueOr("Default")).isEqualTo("Not Default"); assertThat(optStringValue.get().isPresent()).isTrue(); }