@Test
public void testSelectedProperty() {

  JCheckBox checkbox = new JCheckBox();
  checkbox.setSelected(true);
  SelectedProperty selectedProperty = new SelectedProperty(checkbox);
  CountListener listener = new CountListener();
  selectedProperty.addListener(listener);
  assertThat(selectedProperty.get()).isTrue();
  assertThat(listener.getCount()).isEqualTo(0);
  checkbox.setSelected(false);
  assertThat(selectedProperty.get()).isFalse();
  assertThat(listener.getCount()).isEqualTo(1);
  selectedProperty.set(true);
  assertThat(checkbox.isSelected()).isTrue();
  assertThat(listener.getCount()).isEqualTo(2);
}