@Test
public void createActivityTest() throws Exception {

    // Setup:
    User user = userFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/user"));
    Entity generated = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/generated"));
    Entity invalidated = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/invalidated"));
    Entity used = entityFactory.createNew(VALUE_FACTORY.createIRI("http://test.com/used"));
    ActivityConfig config = new ActivityConfig.Builder(Collections.singleton(Activity.class), user)
            .generatedEntity(generated)
            .invalidatedEntity(invalidated)
            .usedEntity(used)
            .build();
    Activity result = service.createActivity(config);
    assertEquals(1, result.getWasAssociatedWith_resource().size());
    TestCase.assertEquals(user.getResource(), result.getWasAssociatedWith_resource().iterator().next());
    assertEquals(1, result.getGenerated().size());
    assertTrue(result.getModel().containsAll(generated.getModel()));
    assertEquals(1, result.getInvalidated().size());
    assertTrue(result.getModel().containsAll(invalidated.getModel()));
    assertEquals(1, result.getUsed().size());
    assertTrue(result.getModel().containsAll(used.getModel()));
}