### Question:
PairWiseMetaAnalysisWizardPresentation extends NetworkMetaAnalysisWizardPM { @Override public boolean rebuildRawAlternativesGraph() { if (super.rebuildRawAlternativesGraph()) { commitRawSelectionToGraph(); return true; } return false; } PairWiseMetaAnalysisWizardPresentation(Domain d, PresentationModelFactory pmm); @Override boolean rebuildRawAlternativesGraph(); @Override boolean rebuildRefinedAlternativesGraph(); ModifiableHolder<TreatmentDefinition> getRawFirstDefinitionModel(); ModifiableHolder<TreatmentDefinition> getRawSecondDefinitionModel(); ModifiableHolder<TreatmentDefinition> getRefinedFirstDefinitionModel(); ModifiableHolder<TreatmentDefinition> getRefinedSecondDefinitionModel(); RandomEffectsMetaAnalysis buildMetaAnalysis(); ValueModel getMetaAnalysisCompleteModel(); PairWiseMetaAnalysisPresentation getMetaAnalysisModel(); MetaAnalysis createAnalysis(String name);  }### Answer:
@Test public void testGetTreatmentDefinitions() { Indication ind = ExampleData.buildIndicationDepression(); OutcomeMeasure ep = ExampleData.buildEndpointHamd(); List<TreatmentDefinition> expected = new ArrayList<TreatmentDefinition>(); expected.add(d_fluoxSet); expected.add(d_paroxSet); expected.add(d_sertrSet); d_wizard.getIndicationModel().setValue(ind); d_wizard.getOutcomeMeasureModel().setValue(ep); d_wizard.rebuildRawAlternativesGraph(); assertEquals(expected, d_wizard.getAvailableRawTreatmentDefinitions()); }
@Test public void testStudyGraphPresentationModel() { TreatmentDefinitionsGraphModel model = d_wizard.getRawAlternativesGraph(); d_wizard.getIndicationModel().setValue(ExampleData.buildIndicationDepression()); d_wizard.getOutcomeMeasureModel().setValue(ExampleData.buildEndpointHamd()); d_wizard.rebuildRawAlternativesGraph(); List<TreatmentDefinition> drugs = new ArrayList<TreatmentDefinition>(); drugs.add(d_fluoxSet); drugs.add(d_paroxSet); drugs.add(d_sertrSet); assertEquals(drugs, model.getDefinitions()); }
@Test public void testDrugListModelEventOnEndpointChange() { d_wizard.getIndicationModel().setValue(ExampleData.buildIndicationDepression()); d_wizard.getOutcomeMeasureModel().setValue(ExampleData.buildEndpointHamd()); d_wizard.rebuildRawAlternativesGraph(); ObservableList<TreatmentDefinition> definitionList = d_wizard.getAvailableRawTreatmentDefinitions(); ListDataListener l = createMock(ListDataListener.class); l.intervalRemoved(ListDataEventMatcher.eqListDataEvent(new ListDataEvent(definitionList, ListDataEvent.INTERVAL_REMOVED, 0, 2))); l.intervalAdded(ListDataEventMatcher.eqListDataEvent(new ListDataEvent(definitionList, ListDataEvent.INTERVAL_ADDED, 0, 2))); replay(l); definitionList.addListDataListener(l); d_wizard.getOutcomeMeasureModel().setValue(ExampleData.buildEndpointCgi()); d_wizard.rebuildRawAlternativesGraph(); verify(l); }