public static void createFileIfAbsent(File file, boolean isDir) throws IOException {
        if (file.exists()) {
            return;
        }
        boolean createResult = isDir ? file.mkdirs() : file.createNewFile();
        if (!createResult && !file.exists()) {
            throw new IllegalStateException("failed to create cache : " + (isDir ? "dir" : file) + file.getPath());
        }
    }
@Test
    void testCreateFileIfAbsentForDir() throws Throwable {
        assertThrows(IllegalStateException.class, () -> {
            File file = mock(File.class);
            DiskCache.createFileIfAbsent(file, true);
        });
    }