File globalStateDir() {
        final File dir = new File(stateDir, "global");
        if (hasPersistentStores) {
            if (!dir.exists() && !dir.mkdir()) {
                throw new ProcessorStateException(
                    String.format("global state directory [%s] doesn't exist and couldn't be created", dir.getPath()));
            } else if (dir.exists() && !dir.isDirectory()) {
                throw new ProcessorStateException(
                    String.format("global state directory [%s] can't be created as there is an existing file with the same name", dir.getPath()));
            }
        }
        return dir;
    }
@Test
    public void shouldNotCreateGlobalStateDirectory() throws IOException {
        initializeStateDirectory(false, false);
        final File globalStateDir = directory.globalStateDir();
        assertFalse(globalStateDir.exists());
    }