@Test
public void getActivityTest() throws Exception {

    // Setup:
    Activity activity = activityFactory.createNew(activityIRI);
    Entity generated = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/generated"), activity.getModel());
    Entity invalidated = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/invalidated"), activity.getModel());
    Entity used = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/used"), activity.getModel());
    activity.setGenerated(Collections.singleton(generated));
    activity.setInvalidated(Collections.singleton(invalidated));
    activity.setUsed(Collections.singleton(used));
    try (RepositoryConnection conn = repo.getConnection()) {
        conn.add(activity.getModel());
    }
    Optional<Activity> result = service.getActivity(activity.getResource());
    assertTrue(result.isPresent());
    result.get().getModel().forEach(statement -> assertTrue(activity.getModel().contains(statement)));
}