### Question:
DepartmentOntologyUtil implements VocabularyHelper { @Override public Set<String> getInvalidTerms(final Element modsRoot) throws JDOMException { return getInvalidTerms(modsRoot, false); } DepartmentOntologyUtil(); @Override List<List<String>> getAuthoritativeForm(final String affiliation); @Override List<List<String>> getAuthoritativeForms(final Element docElement); @Override boolean updateDocumentTerms(final Element docElement); static void collapsePaths(final List<List<String>> paths); @Override Set<String> getInvalidTerms(final Element modsRoot); @Override Set<String> getInvalidTermsWithPrefix(final Element modsRoot); Set<String> getInvalidTerms(final Element modsRoot, final boolean includePrefix); Map<String, DepartmentConcept> getDepartments(); @Override void setSelector(final String selector); XPathExpression<Element> getNamePath(); @Override Collection<String> getVocabularyTerms(); @Override String getInvalidTermPrefix(); @Override void setContent(final byte[] content); @Override String getVocabularyURI(); @Override void setVocabularyURI(final String vocabularyURI); @Override void setSelectorNamespaces(final Namespace[] namespaces); @Override String getSelector();  }### Answer:
@Test public void getInvalidTermsTest() throws Exception { SAXBuilder builder = new SAXBuilder(); InputStream modsStream = new FileInputStream(new File("src/test/resources/samples/mods.xml")); Document modsDoc = builder.build(modsStream); Set<String> invalids = job.getInvalidTerms(modsDoc.getRootElement()); assertEquals("Did not detect invalid affiliation", 1, invalids.size()); }