@Test
    public void testCacheInvalidation() throws Exception {
        MockCurator curator = new MockCurator();
        CachingCurator database = new CachingCurator(curator, Path.fromString("/"), true);

        assertEquals(0L, (long)curator.counter("/changeCounter").get().get().postValue());
        commitCreate("/1", database);
        assertArrayEquals(new byte[0], database.getData(Path.fromString("/1")).get());
        commitReadingWrite("/1", "hello".getBytes(), database);
        // Data cached during commit of write transaction. Should be invalid now, and re-read.
        assertEquals(4L, (long)curator.counter("/changeCounter").get().get().postValue());
        assertArrayEquals("hello".getBytes(), database.getData(Path.fromString("/1")).get());

        assertEquals(0, database.getChildren(Path.fromString("/1")).size());
        commitCreate("/1/1", database);
        assertEquals(1, database.getChildren(Path.fromString("/1")).size());
    }
Tests the curator db directly.
This verifies the details of the current implementation of the database, not just its API;
breaking this does not necessarily mean that a change is wrong.

@author bratseth
node-repository/src/test/java/com/yahoo/vespa/hosted/provision/persistence/CachingCuratorTest.java