@Test
public void iconPropertyCanWrapLabel() throws Exception {

  JLabel label = new JLabel();
  Icon dummyIcon = new DummyIcon();
  IconProperty iconProperty = new IconProperty(label);
  CountListener listener = new CountListener();
  iconProperty.addListener(listener);
  assertThat(iconProperty.get().isPresent()).isFalse();
  assertThat(listener.getCount()).isEqualTo(0);
  label.setIcon(dummyIcon);
  assertThat(iconProperty.get().isPresent()).isTrue();
  assertThat(iconProperty.getValue()).isEqualTo(dummyIcon);
  assertThat(listener.getCount()).isEqualTo(1);
  label.setIcon(null);
  assertThat(iconProperty.get().isPresent()).isFalse();
  assertThat(listener.getCount()).isEqualTo(2);
}