List<TaskDirectory> listAllTaskDirectories() {
        return listTaskDirectories(pathname -> pathname.isDirectory() && TASK_DIR_PATH_NAME.matcher(pathname.getName()).matches());
    }
@Test
    public void shouldReturnEmptyArrayIfStateDirDoesntExist() throws IOException {
        cleanup();
        assertFalse(stateDir.exists());
        assertTrue(directory.listAllTaskDirectories().isEmpty());
    }