ObjectProperty extends AbstractProperty<T> implements ObservableObject<T> { public static <T> ObjectProperty<T> wrap(@NotNull OptionalProperty<T> optionalProperty) { return new OptionalWrapper<>(optionalProperty, null); }  static ObjectProperty<T> wrap(@NotNull OptionalProperty<T> optionalProperty); static ObjectProperty<T> wrap(@NotNull OptionalProperty<T> optionalProperty, @NotNull String id);  }
@Test public void testObjectPropertyCanWrapOptionalProperty() { Person person1 = new Person("John Doe", 25); Person person2 = new Person("Jane Doe", 21); OptionalProperty<Person> optionalPersonProperty = new OptionalValueProperty<>(person1); ObjectProperty<Person> personProperty = ObjectProperty.wrap(optionalPersonProperty); assertThat(personProperty.get()).isEqualTo(person1); personProperty.set(person2); assertThat(optionalPersonProperty.getValue()).isEqualTo(person2); optionalPersonProperty.clear(); try { personProperty.get(); Assert.fail(); } catch (Exception expected) { } }