SavedFiltersPresenter implements RestoreDefaultFiltersMenuBuilder.SupportsRestoreDefaultFilters { public void onSaveDefaultActiveFilter(@Observes final SavedFilterAsDefaultActiveEvent event) { filterSettingsManager.saveDefaultActiveFilter(event.getSavedFilter().getKey(), () -> view.updateSavedFiltersDefault(event.getSavedFilter().getKey()) ); }  @WorkbenchPartView IsElement getView(); @WorkbenchPartTitle String getTitle(); @PostConstruct void init(); @WorkbenchMenu void getMenus(final Consumer<Menus> menusConsumer); void setFilterSettingsManager(final FilterSettingsManager filterSettingsManager); void onSaveFilter(@Observes final SavedFilterAddedEvent event); void onRemoveSavedFilter(@Observes final SavedFilterRemoveEvent event); @Override void onRestoreDefaultFilters(); void onSaveDefaultActiveFilter(@Observes final SavedFilterAsDefaultActiveEvent event);  }
@Test public void testOnSaveDefaultActiveFilter() { String defaultFilterKey = "filterKey"; final SavedFilter filter = new SavedFilter(defaultFilterKey, "name"); doAnswer(invocation -> { Command callback = (Command) invocation.getArguments()[1]; callback.execute(); return null; }).when(filterSettingsManager).saveDefaultActiveFilter(anyString(), any()); presenter.onSaveDefaultActiveFilter(new SavedFilterAsDefaultActiveEvent(filter)); verify(filterSettingsManager).saveDefaultActiveFilter(eq(filter.getKey()), any()); verify(view).updateSavedFiltersDefault(defaultFilterKey); }