@Test public void testDeleteNode() { Transaction tx = graphDb.beginTx(); String query = "MATCH n-[r]-() DELETE n, r"; graphDb.execute(query); query = "MATCH (n) WHERE HAS (n.geohash) DELETE n"; graphDb.execute(query); root = PrefixTree.getOrCreateRoot(INDEXLABEL, graphDb); List<Node> candidate = gendata.insertNode(graphDb, 10, true); for (Node node : candidate) { PrefixTree.addNode(graphDb, root, node); } List<Node> child = PrefixTree.getChild((String) candidate.get(0).getProperty(GEOHASH), root, 7); assertTrue(candidate.get(0).getProperty(GEOHASH) == child.get(0).getProperty(GEOHASH)); PrefixTree.deleteNode(candidate.get(0)); child = PrefixTree.getChild((String) candidate.get(0).getProperty(GEOHASH), root, 7); assertEquals(child.size(), 0); tx.close(); graphDb.shutdown(); }