AppsPresenter { public void showAllApps() { appsActivity.showApps(sort(appsProvider.findInstalledApps())); } AppsPresenter(AppsActivity appsActivity, AppsProvider appsProvider); void showAllApps(); void filterApps(String text);  }
@Test public void should_show_all_apps() throws Exception { when(appsProvider.findInstalledApps()).thenReturn(Arrays.asList(new App("BBB"), new App("AAA"))); appsPresenter.showAllApps(); verify(activity).showApps(Arrays.asList(new App("AAA"), new App("BBB"))); }