@Test
public void testGetEntityUsages() throws Exception {

    Set<String> subjects = Stream.of("http://mobi.com/ontology#Class1b",
            "http://mobi.com/ontology#Individual1a").collect(Collectors.toSet());
    Set<String> predicates = Stream.of("http://www.w3.org/2000/01/rdf-schema#subClassOf",
            "http://www.w3.org/1999/02/22-rdf-syntax-ns#type").collect(Collectors.toSet());
    TupleQueryResult result = queryOntology.getEntityUsages(vf.createIRI("http://mobi.com/ontology#Class1a"));
    assertTrue(result.hasNext());
    result.forEach(b -> {
        Optional<Binding> optionalSubject = b.getBinding("s");
        if (optionalSubject.isPresent()) {
            String subject = optionalSubject.get().getValue().stringValue();
            assertTrue(subjects.contains(subject));
            subjects.remove(subject);
        }
        Optional<Binding> optionalPredicate = b.getBinding("p");
        if (optionalPredicate.isPresent()) {
            String predicate = optionalPredicate.get().getValue().stringValue();
            assertTrue(predicates.contains(predicate));
            predicates.remove(predicate);
        }
    });
    assertEquals(0, subjects.size());
    assertEquals(0, predicates.size());
}