### Question:
DependenciesItemPresenter { public DependenciesItemPresenter setup(final EnhancedDependency enhancedDependency, final WhiteList whiteList, final DependenciesPresenter dependenciesPresenter) { this.enhancedDependency = enhancedDependency; this.parentPresenter = dependenciesPresenter; final Dependency dependency = enhancedDependency.getDependency(); validator = new DependencyValidator(dependency); view.init(this); view.setGroupId(dependency.getGroupId()); view.setArtifactId(dependency.getArtifactId()); view.setVersion(dependency.getVersion()); view.setPackagesWhiteListedState(WhiteListedPackagesState.from(whiteList, enhancedDependency.getPackages())); view.setTransitiveDependency(enhancedDependency instanceof TransitiveEnhancedDependency); return this; } @Inject  DependenciesItemPresenter(final View view); DependenciesItemPresenter setup(final EnhancedDependency enhancedDependency,
                                           final WhiteList whiteList,
                                           final DependenciesPresenter dependenciesPresenter); void onGroupIdChange(final String groupId); void onArtifactIdChange(final String artifactId); void onVersionChange(final String version); void addAllPackagesToWhiteList(); void removeAllPackagesFromWhiteList(); void remove(); View getView();  }### Answer:
@Test public void testSetupNormal() { dependenciesItemPresenter.setup( new NormalEnhancedDependency(mock(Dependency.class), emptySet()), new WhiteList(), mock(DependenciesPresenter.class)); verify(view).init(any()); verify(view).setGroupId(any()); verify(view).setArtifactId(any()); verify(view).setVersion(any()); verify(view).setPackagesWhiteListedState(any()); verify(view).setTransitiveDependency(eq(false)); }
@Test public void testSetupTransitive() { dependenciesItemPresenter.setup( new TransitiveEnhancedDependency(mock(Dependency.class), emptySet()), new WhiteList(), mock(DependenciesPresenter.class)); verify(view).init(any()); verify(view).setGroupId(any()); verify(view).setArtifactId(any()); verify(view).setVersion(any()); verify(view).setPackagesWhiteListedState(any()); verify(view).setTransitiveDependency(eq(true)); }