OptionalProperty extends AbstractProperty<Optional<T>> implements ObservableOptional<T> { public final void setNullableValue(@Nullable T value) { if (value != null) { setValue(value); } else { clear(); } }  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 testSetNullableValue() throws Exception { OptionalProperty<String> optStringValue = OptionalValueProperty.absent(); optStringValue.setNullableValue("Hello"); assertThat(optStringValue.getValue()).isEqualTo("Hello"); optStringValue.setNullableValue(null); assertThat(optStringValue.get().isPresent()).isEqualTo(false); }