### Question:
AddProjectPopUpView implements AddProjectPopUpPresenter.View,
                                            IsElement { @EventHandler("advanced-options-anchor") public void advancedOptionsAnchorOnClick(final ClickEvent clickEvent) { if (advancedOptions.getHidden()) { advancedOptions.setHidden(false); advancedOptionsAnchor.setTextContent(ts.format(LibraryConstants.RestoreAdvancedOptions)); } else { advancedOptions.setHidden(true); advancedOptionsAnchor.setTextContent(ts.format(LibraryConstants.ConfigureAdvancedOptions)); presenter.restoreAdvancedOptions(); } } AddProjectPopUpView();  AddProjectPopUpView(final AddProjectPopUpPresenter presenter,
                               final TranslationService ts,
                               final Div advancedOptions,
                               final Anchor advancedOptionsAnchor); @Override void init(final AddProjectPopUpPresenter presenter); @Override String getName(); @Override String getDescription(); @Override String getGroupId(); @Override String getArtifactId(); @Override String getVersion(); @Override boolean isBasedOnTemplate(); @Override void setDescription(String description); @Override void setGroupId(String groupId); @Override void setArtifactId(String artifactId); @Override void setVersion(String version); @Override boolean isAdvancedOptionsSelected(); @Override void show(); @Override void showError(final String errorMessage); @Override void hide(); @Override String getSavingMessage(); @Override String getAddProjectSuccessMessage(); @Override String getDuplicatedProjectMessage(); @Override String getEmptyNameMessage(); @Override String getInvalidNameMessage(); @Override String getEmptyGroupIdMessage(); @Override String getInvalidGroupIdMessage(); @Override String getEmptyArtifactIdMessage(); @Override String getInvalidArtifactIdMessage(); @Override String getEmptyVersionMessage(); @Override String getInvalidVersionMessage(); @Override void setAddButtonEnabled(final boolean enabled); @Override void setTemplates(final List<String> templates,
                             final int selectedIdx); @Override String getSelectedTemplate(); @Override void enableBasedOnTemplatesCheckbox(final boolean isEnabled); @Override void showBusyIndicator(final String message); @Override void hideBusyIndicator(); @EventHandler("advanced-options-anchor") void advancedOptionsAnchorOnClick(final ClickEvent clickEvent); @EventHandler("based-on-template-checkbox") void onIncludeChanged(final ChangeEvent event); @EventHandler("name") void setProjectNameAndArtifactId(final KeyUpEvent keyUpEvent);  }### Answer:
@Test public void testConfigureAdvancedOptions() { ClickEvent clickEvent = mock(ClickEvent.class); doReturn(true).when(advancedOptions).getHidden(); doReturn("restore").when(translationService).format(LibraryConstants.RestoreAdvancedOptions); view.advancedOptionsAnchorOnClick(clickEvent); verify(advancedOptions).setHidden(false); verify(translationService).format(LibraryConstants.RestoreAdvancedOptions); verify(advancedOptionsAnchor).setTextContent("restore"); verify(presenter, never()).restoreAdvancedOptions(); }
@Test public void testRestoreAdvancedOptions() { ClickEvent clickEvent = mock(ClickEvent.class); doReturn(false).when(advancedOptions).getHidden(); doReturn("configure").when(translationService).format(LibraryConstants.ConfigureAdvancedOptions); view.advancedOptionsAnchorOnClick(clickEvent); verify(advancedOptions).setHidden(true); verify(translationService).format(LibraryConstants.ConfigureAdvancedOptions); verify(advancedOptionsAnchor).setTextContent("configure"); verify(presenter).restoreAdvancedOptions(); }