### Question:
NewDependencyPopup { public void onOkClicked() { if (validator.validate()) { callback.callback(dependency); view.hide(); } else { validateGroupId(); validateArtifactId(); validateVersion(); } } @Inject  NewDependencyPopup(final NewDependencyPopupView view); void show(final Callback<Dependency> callback); void onOkClicked(); void onGroupIdChange(final String groupId); void validateGroupId(); void onArtifactIdChange(final String artifactId); void validateArtifactId(); void onVersionChange(final String version); void validateVersion();  }### Answer:
@Test public void testFillValidDependency() throws Exception { fillInValidGAV(); newDependencyPopup.onOkClicked(); verify( callback ).callback( any( Dependency.class ) ); verify( view ).hide(); }
@Test public void testCloseIfDependencyValid() throws Exception { fillInValidGAV(); newDependencyPopup.onOkClicked(); verify( view ).hide(); }