@Test public void testSetup() { presenter.setup(providerType, providerTypes); verify(view, times(1)).clear(); providerTypes.forEach(providerType -> verify(view, times(1)).addProviderType(eq(providerType.getKey()), eq(getDisplayableProviderTypeName(providerType)), any(Command.class))); }
public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); }
ProviderTypeNavigationPresenter { public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); } }
ProviderTypeNavigationPresenter { public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); } @Inject  ProviderTypeNavigationPresenter(final View view,
                                           final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent,
                                           final Event<ProviderTypeListRefreshEvent> providerTypeListRefreshEvent,
                                           final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); }
ProviderTypeNavigationPresenter { public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); } @Inject  ProviderTypeNavigationPresenter(final View view,
                                           final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent,
                                           final Event<ProviderTypeListRefreshEvent> providerTypeListRefreshEvent,
                                           final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); void setup(final ProviderType firstProvider,
                      final Collection<ProviderType> providerTypes); View getView(); void clear(); void onRefresh(); void onAddProviderType(); }
ProviderTypeNavigationPresenter { public void setup(final ProviderType firstProvider, final Collection<ProviderType> providerTypes) { view.clear(); this.providerTypes.clear(); addProviderType(checkNotNull("firstProvider", firstProvider)); providerTypes.stream() .filter(providerType -> !providerType.equals(firstProvider)) .forEach(this::addProviderType); } @Inject  ProviderTypeNavigationPresenter(final View view,
                                           final Event<AddNewProviderTypeEvent> addNewProviderTypeEvent,
                                           final Event<ProviderTypeListRefreshEvent> providerTypeListRefreshEvent,
                                           final Event<ProviderTypeSelectedEvent> providerTypeSelectedEvent); @PostConstruct void init(); void setup(final ProviderType firstProvider,
                      final Collection<ProviderType> providerTypes); View getView(); void clear(); void onRefresh(); void onAddProviderType();  }