public static void createNewFile(String filePath) throws IOException {
        File file = new File(filePath);
        if (file.exists()) {
            file.delete();
        }

        if (!file.getParentFile().exists()) {
            createParentFile(file);
        }
        file.createNewFile();
    }
@Test
    public void createNewFile() throws IOException {
        // create new file
        FileUtils.createNewFile("/tmp/test.txt");
        Assertions.assertEquals("", FileUtils.readFileToStr(Paths.get("/tmp/test.txt")));

        // delete exist file and create new file
        FileUtils.writeStringToFile("/tmp/test2.txt", "test");
        Path test2 = Paths.get("/tmp/test2.txt");
        Assertions.assertEquals("test", FileUtils.readFileToStr(test2).trim());
        FileUtils.createNewFile("/tmp/test2.txt");
        Assertions.assertEquals("", FileUtils.readFileToStr(test2));

        // create new file with not exist folder
        FileUtils.createNewFile("/tmp/newfolder/test.txt");
        Assertions.assertEquals("", FileUtils.readFileToStr(Paths.get("/tmp/newfolder/test.txt")));

        FileUtils.createNewFile("/tmp/newfolder/newfolder2/newfolde3/test.txt");
        Assertions.assertEquals(
                "",
                FileUtils.readFileToStr(Paths.get("/tmp/newfolder/newfolder2/newfolde3/test.txt")));
    }