@Test
public void deleteStateTest() throws Exception {

    // Setup:
    Model model = MODEL_FACTORY.createModel();
    model.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"));
    state.setStateResource(Collections.singleton(VALUE_FACTORY.createIRI("http://example.com/example")));
    RepositoryConnection conn = repo.getConnection();
    conn.add(state.getModel());
    conn.add(model);
    manager.deleteState(state.getResource());
    Model stateModel = MODEL_FACTORY.createModel();
    conn.getStatements(state.getResource(), null, null).forEach(stateModel::add);
    assertTrue(stateModel.isEmpty());
    model.forEach(statement ->
            assertFalse(conn.getStatements(statement.getSubject(), statement.getPredicate(), statement.getObject()).hasNext()));
    conn.close();
}