@Test
public void testPainterChangeListener() {

    JXPanel panel = new JXPanel();
    final MattePainter painter = new MattePainter(Color.RED);
    int listenerCount = painter.getPropertyChangeListeners().length;
    panel.setBackgroundPainter(painter);
    assertEquals(listenerCount +1, painter.getPropertyChangeListeners().length);
    panel.setBackgroundPainter(null);
    assertEquals(listenerCount, painter.getPropertyChangeListeners().length);
}