    @Test
    public void testGetOrCreateNode() throws Exception {

        GraphDatabaseService db = setUpDb();
        NodeManager nodeManager = new NodeManager();
        NodeManager.globalNodeCache.invalidateAll();
        DataNodeManager.dataCache.invalidateAll();
        DataNodeManager dataNodeManager = new DataNodeManager();

        // Write some nodes to the database
        Node a = nodeManager.getOrCreateNode(dataNodeManager, "a", db);
        Node b = nodeManager.getOrCreateNode(dataNodeManager, "b", db);
        Node c = nodeManager.getOrCreateNode(dataNodeManager, "c", db);
        Node d = nodeManager.getOrCreateNode(dataNodeManager, "d", db);
        Node e = nodeManager.getOrCreateNode(dataNodeManager, "e", db);
        Node f = nodeManager.getOrCreateNode(dataNodeManager, "f", db);
        Node g = nodeManager.getOrCreateNode(dataNodeManager, "g", db);

        Assert.assertNotNull(a);
        Assert.assertNotNull(b);
        Assert.assertNotNull(c);
        Assert.assertNotNull(d);
        Assert.assertNotNull(e);
        Assert.assertNotNull(f);
        Assert.assertNotNull(g);

        String expected = "a";

        Transaction tx = db.beginTx();
        String actual = (String)a.getProperty("value");
        tx.success();
        Assert.assertEquals(expected, actual);
    }