@Test public void refreshPieChartTest() { @SuppressWarnings("unchecked") final Map<MatcherType, Integer> map = mock(Map.class); when(model.getMatchersByType()).thenReturn(map); final CountDownLatch latch = mock(CountDownLatch.class); presenter.refreshPieChart(latch); verify(model).getMatchersByType(); verify(latch).countDown(); verify(view).displayPieChart(same(map)); }
@VisibleForTesting void refreshPieChart(final CountDownLatch latch) { final Supplier<Map<MatcherType, Integer>> supplier = () -> { try { return model.getMatchersByType(); } finally { latch.countDown(); } }; taskRunner.compute(supplier, view::displayPieChart); }
RulesTabPresenter extends TabPresenter<RulesTabView> { @VisibleForTesting void refreshPieChart(final CountDownLatch latch) { final Supplier<Map<MatcherType, Integer>> supplier = () -> { try { return model.getMatchersByType(); } finally { latch.countDown(); } }; taskRunner.compute(supplier, view::displayPieChart); } }
RulesTabPresenter extends TabPresenter<RulesTabView> { @VisibleForTesting void refreshPieChart(final CountDownLatch latch) { final Supplier<Map<MatcherType, Integer>> supplier = () -> { try { return model.getMatchersByType(); } finally { latch.countDown(); } }; taskRunner.compute(supplier, view::displayPieChart); } RulesTabPresenter(final GuiTaskRunner taskRunner,
        final MainWindowView mainView, final TraceDb traceDb); }
RulesTabPresenter extends TabPresenter<RulesTabView> { @VisibleForTesting void refreshPieChart(final CountDownLatch latch) { final Supplier<Map<MatcherType, Integer>> supplier = () -> { try { return model.getMatchersByType(); } finally { latch.countDown(); } }; taskRunner.compute(supplier, view::displayPieChart); } RulesTabPresenter(final GuiTaskRunner taskRunner,
        final MainWindowView mainView, final TraceDb traceDb); @Override CountDownLatch refresh(); @Override void load(); }
RulesTabPresenter extends TabPresenter<RulesTabView> { @VisibleForTesting void refreshPieChart(final CountDownLatch latch) { final Supplier<Map<MatcherType, Integer>> supplier = () -> { try { return model.getMatchersByType(); } finally { latch.countDown(); } }; taskRunner.compute(supplier, view::displayPieChart); } RulesTabPresenter(final GuiTaskRunner taskRunner,
        final MainWindowView mainView, final TraceDb traceDb); @Override CountDownLatch refresh(); @Override void load();  }