@Test
public final void testAddUsageListenerStartsThread() throws Exception {       

    int activeThreadCount = Thread.activeCount();
    underTest = new MemoryUsage();
    underTest.setExecutor(executor);
    underTest.setLimit(10);
    underTest.start();
    final CountDownLatch called = new CountDownLatch(1);
    final String[] listnerThreadNameHolder = new String[1];
    underTest.addUsageListener(new UsageListener() {
        public void onUsageChanged(Usage usage, int oldPercentUsage,
                int newPercentUsage) {
            called.countDown();
            listnerThreadNameHolder[0] = Thread.currentThread().toString();
        }
    });
    underTest.increaseUsage(1);
    assertTrue("listener was called", called.await(30, TimeUnit.SECONDS));
    assertTrue("listener called from another thread", !Thread.currentThread().toString().equals(listnerThreadNameHolder[0]));
    assertEquals("usage is correct", 10, underTest.getPercentUsage());
    assertEquals("new thread created with listener", activeThreadCount + 1, Thread.activeCount());        
}