@Test
public void stateExistsForUserTest() throws Exception {

    // Setup:
    RepositoryConnection conn = repo.getConnection();
    conn.add(VALUE_FACTORY.createIRI("http://mobi.com/states/0"), VALUE_FACTORY.createIRI(RDF.TYPE.stringValue()), VALUE_FACTORY.createIRI(State.TYPE));
    conn.add(VALUE_FACTORY.createIRI("http://mobi.com/states/0"), VALUE_FACTORY.createIRI(State.forUser_IRI), user.getResource());
    conn.add(VALUE_FACTORY.createIRI("http://mobi.com/states/1"), VALUE_FACTORY.createIRI(RDF.TYPE.stringValue()), VALUE_FACTORY.createIRI(State.TYPE));
    conn.add(VALUE_FACTORY.createIRI("http://mobi.com/states/2"), VALUE_FACTORY.createIRI(DCTERMS.TITLE.stringValue()), VALUE_FACTORY.createLiteral("Title"));
    assertTrue(manager.stateExistsForUser(VALUE_FACTORY.createIRI("http://mobi.com/states/0"), "test"));
    assertFalse(manager.stateExistsForUser(VALUE_FACTORY.createIRI("http://mobi.com/states/1"), "test"));
    conn.close();
}