### Question:
SelectableTreatmentDefinitionsGraphModel extends TreatmentDefinitionsGraphModel { public boolean isSelectionConnected() { UndirectedGraph<Vertex, Edge> g = getSelectedDefinitionsGraph(); ConnectivityInspector<Vertex, Edge> inspector = new ConnectivityInspector<Vertex, Edge>(g); Set<Vertex> connectedDrugs = inspector.connectedSetOf(this.findVertex(d_selectedDefinitions.get(0))); for (TreatmentDefinition d : d_selectedDefinitions) { if (!connectedDrugs.contains(this.findVertex(d))) { return false; } } return true; } SelectableTreatmentDefinitionsGraphModel(ObservableList<Study> studies, 
			ObservableList<TreatmentDefinition> definitions, 
			ValueHolder<OutcomeMeasure> outcome, 
			int minSelection, 
			int maxSelection); @Override void rebuildGraph(); ValueHolder<Boolean> getSelectionCompleteModel(); ObservableList<TreatmentDefinition> getSelectedDefinitions(); boolean isSelectionConnected(); UndirectedGraph<Vertex, Edge> getSelectedDefinitionsGraph();  }### Answer:
@Test public void testIsSelectionConnected() { assertTrue(d_pm.isSelectionConnected()); d_drugs.remove(TreatmentDefinition.createTrivial(ExampleData.buildDrugFluoxetine())); d_pm.getSelectedDefinitions().clear(); d_pm.getSelectedDefinitions().addAll(d_drugs); assertFalse(d_pm.isSelectionConnected()); }