### Question:
RefreshTreeController { public void refresh(final DataGroupInfo dataGroup) { if (dataGroup instanceof RefreshableDataGroupInfo) { ThreadUtilities.runBackground(new Runnable() { @Override public void run() { ((RefreshableDataGroupInfo)dataGroup).refresh(); } }); } }  void refresh(final DataGroupInfo dataGroup);  }### Answer:
@Test public void testRefresh() throws InterruptedException { EasyMockSupport support = new EasyMockSupport(); DataGroupInfo group = support.createMock(DataGroupInfo.class); support.replayAll(); RefreshTreeController controller = new RefreshTreeController(); controller.refresh(group); CountDownLatch latch = new CountDownLatch(1); controller.refresh(new RefreshableGroupMock(latch)); latch.await(); support.verifyAll(); }