### Question:
AddStudyWizardPresentation { public Study saveStudy() { if (getArms().isEmpty()) throw new IllegalStateException("No arms selected in study."); if (!isIdAvailable()) throw new IllegalStateException("Study with this ID already exists in domain"); if (isEditing()) { try { d_domain.deleteEntity(d_origStudy); } catch (DependentEntitiesException e) { e.printStackTrace(); } } d_domain.getStudies().add(getNewStudy()); return getNewStudy(); } AddStudyWizardPresentation(final Domain d, final PresentationModelFactory pmf, final AddisWindow mainWindow);  AddStudyWizardPresentation(final Domain d, final PresentationModelFactory pmf, final AddisWindow mainWindow, final Study origStudy); ValueModel getSourceModel(); ValueModel getSourceNoteModel(); ValueModel getIdModel(); ValueModel getIdNoteModel(); ValueModel getTitleModel(); Domain getDomain(); ValueHolder<Boolean> shouldImportCTWithResults(); void importCT(); void setNewStudy(final Study study); SortedSetModel<Indication> getIndicationsModel(); ValueModel getIndicationModel(); ValueModel getIndicationNoteModel(); void resetStudy(); MutableCharacteristicHolder getCharacteristicModel(final BasicStudyCharacteristic c); ValueModel getCharacteristicNoteModel(final BasicStudyCharacteristic c); ObservableList<Arm> getArms(); ObservableList<Epoch> getEpochs(); SortedSetModel<Drug> getDrugsModel(); BasicArmPresentation getArmModel(final int armNumber); AddArmsPresentation getAddArmsModel(); AddEpochsPresentation getAddEpochsModel(); TreatmentActivityPresentation getTreatmentActivityModel(final int armNumber); ValueModel getArmNoteModel(final int idx); StudyMeasurementTableModel getEndpointMeasurementTableModel(); Study saveStudy(); boolean isIdAvailable(); StudyPresentation getNewStudyPM(); OutcomeMeasurementsModel getAdverseEventsModel(); OutcomeMeasurementsModel getEndpointsModel(); OutcomeMeasurementsModel getPopulationCharsModel(); SelectFromFiniteListPresentation<AdverseEvent> getAdverseEventSelectModel(); SelectFromFiniteListPresentation<Endpoint> getEndpointSelectModel(); SelectFromFiniteListPresentation<PopulationCharacteristic> getPopulationCharSelectModel(); boolean isEditing(); Study getOldStudy(); static final String CLINICALTRIALS_GOV_BASE; }### Answer:
@Test public void testSaveStudy() { d_wizard.getNewStudyPM().getBean().setName("This is not in the domain"); d_wizard.getEndpointSelectModel().getSlot(0).setValue(d_domain.getEndpoints().get(0)); d_wizard.getIndicationModel().setValue(d_domain.getIndications().get(0)); d_wizard.saveStudy(); assertTrue(d_domain.getStudies().contains(d_wizard.getStudy())); }