@Test
public void updateActivityTest() throws Exception {

    // Setup:
    IRI titleIRI = VALUE_FACTORY.createIRI(_Thing.title_IRI);
    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());
    }
    activity.addProperty(VALUE_FACTORY.createLiteral("Activity"), titleIRI);
    generated.addProperty(VALUE_FACTORY.createLiteral("Generated"), titleIRI);
    invalidated.addProperty(VALUE_FACTORY.createLiteral("Invalidated"), titleIRI);
    used.addProperty(VALUE_FACTORY.createLiteral("Used"), titleIRI);
    service.updateActivity(activity);
    try (RepositoryConnection conn = repo.getConnection()) {
        activity.getModel().forEach(statement -> conn.contains(statement.getSubject(), statement.getPredicate(), statement.getObject()));
    }
}