@Test public void simple_inheritance_dag_is_allowed() { Search grandfather = createSearchWithName("grandfather"); Search father = createSearchWithName("father", grandfather); Search son = createSearchWithName("son", father); DocumentGraphValidator validator = new DocumentGraphValidator(); validator.validateDocumentGraph(documentListOf(son, father, grandfather)); }
public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } } }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  void validateDocumentGraph(List<SDDocumentType> documents); }
DocumentGraphValidator { public void validateDocumentGraph(List<SDDocumentType> documents) { for (SDDocumentType document : documents) { validateRoot(document); } }  void validateDocumentGraph(List<SDDocumentType> documents);  }