### Question:
WizardController extends AbstractController implements Initializable { public void finishWizard() { if (identity != null && !aliasInput.getText().isEmpty()) { boolean hasEmail = identity.getEmail() != null && !identity.getEmail().isEmpty(); boolean hasPhone = identity.getPhone() != null && !identity.getPhone().isEmpty(); boolean uploadEnabled = hasEmail || hasPhone; identity.setUploadEnabled(uploadEnabled); saveIdentity(); clientConfiguration.selectIdentity(identity); if (uploadEnabled) { new Thread(() -> indexService.updateIdentity(identity, null)).start(); } } buttonClosePopup(); }  @Override void initialize(URL location, ResourceBundle resources); void next(); void back(); VBox getCurrentStep(); void showPopup(); void buttonClosePopup(); void finishWizard(); @FXML
    public Label nameInstructions; @FXML
    public Label emailInstructions; @FXML
    public Label phoneInstructions; @FXML
    public Label finishWizard; @FXML
    public StackPane wizardPane; }### Answer:
@Test public void testAddsEmail() throws EntityNotFoundException, PersistenceException { goToStep2(); controller.emailInput.setText("test@test.de"); controller.finishWizard(); Identities identities = identityRepository.findAll(); Identity selectedIdentity = controller.clientConfiguration.getSelectedIdentity(); assertEquals("test@test.de", identities.getByKeyIdentifier(selectedIdentity.getKeyIdentifier()).getEmail()); assertTrue(selectedIdentity.isUploadEnabled()); assertAsync(() -> verify(indexService).updateIdentity(selectedIdentity, null)); }