@Test
public void testGetConceptRelationships() throws Exception {

    // Setup:
    Set<Resource> expectedSubjects = Stream.of(vf.createIRI("https://mobi.com/vocabulary#Concept1"), vf.createIRI("https://mobi.com/vocabulary#Concept2"),
            vf.createIRI("https://mobi.com/vocabulary#Concept3"), vf.createIRI("https://mobi.com/vocabulary#Concept4"))
            .collect(Collectors.toSet());
    Map<String, Set<String>> expectedParentMap = new HashMap<>();
    expectedParentMap.put("https://mobi.com/vocabulary#Concept1", Stream.of("https://mobi.com/vocabulary#Concept2", "https://mobi.com/vocabulary#Concept3").collect(Collectors.toSet()));
    Map<String, Set<String>> expectedChildMap = new HashMap<>();
    expectedChildMap.put("https://mobi.com/vocabulary#Concept2", Collections.singleton("https://mobi.com/vocabulary#Concept1"));
    expectedChildMap.put("https://mobi.com/vocabulary#Concept3", Collections.singleton("https://mobi.com/vocabulary#Concept1"));
    Hierarchy result = queryVocabulary.getConceptRelationships(vf, mf);
    Map<String, Set<String>> parentMap = result.getParentMap();
    Set<String> parentKeys = parentMap.keySet();
    assertEquals(expectedParentMap.keySet(), parentKeys);
    parentKeys.forEach(iri -> assertEquals(expectedParentMap.get(iri), parentMap.get(iri)));
    Map<String, Set<String>> childMap = result.getChildMap();
    Set<String> childKeys = childMap.keySet();
    assertEquals(expectedChildMap.keySet(), childKeys);
    childKeys.forEach(iri -> assertEquals(expectedChildMap.get(iri), childMap.get(iri)));
    assertEquals(expectedSubjects, result.getModel().subjects());
}