OptionalProperty extends AbstractProperty<Optional<T>> implements ObservableOptional<T> { @NotNull @Override public final ObservableBool isPresent() { return new BooleanExpression(this) { @NotNull @Override public Boolean get() { return OptionalProperty.this.get().isPresent(); } }; }  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 testInitializationByStaticMethodAbsent() { OptionalProperty<String> optStringValue = OptionalValueProperty.absent(); assertThat(optStringValue.get().isPresent()).isFalse(); }
@Test public void testInitializationByStaticMethodFromNullableWithValue() throws Exception { OptionalProperty<String> optStringValue = OptionalValueProperty.fromNullable("Test"); assertThat(optStringValue.get().isPresent()).isTrue(); }
@Test public void testInitializationByStaticMethodFromNullableWithNull() throws Exception { OptionalProperty<String> optStringValue = OptionalValueProperty.fromNullable(null); assertThat(optStringValue.get().isPresent()).isFalse(); }