@Test
public void updateStateThatWasEmptyTest() throws Exception {

    // Setup:
    Model newModel = MODEL_FACTORY.createModel();
    newModel.add(VALUE_FACTORY.createIRI("http://example.com/example"), VALUE_FACTORY.createIRI(DCTERMS.TITLE.stringValue()), VALUE_FACTORY.createLiteral("Title"));
    State state = stateFactory.createNew(VALUE_FACTORY.createIRI("http://mobi.com/states/0"));
    RepositoryConnection conn = repo.getConnection();
    conn.add(state.getModel());
    manager.updateState(state.getResource(), newModel);
    Model stateModel = MODEL_FACTORY.createModel();
    conn.getStatements(state.getResource(), null, null).forEach(stateModel::add);
    assertFalse(stateModel.isEmpty());
    newModel.forEach(statement -> {
        assertTrue(stateModel.contains(state.getResource(), VALUE_FACTORY.createIRI(State.stateResource_IRI), statement.getSubject()));
        assertTrue(conn.getStatements(statement.getSubject(), statement.getPredicate(), statement.getObject()).hasNext());
    });
    conn.close();
}