docs: public static File createUniqueFile(File directory, String filename) throws IOException {
  
          File uniqueFile = new File(directory, filename);
          if (uniqueFile.createNewFile()) {
              return (uniqueFile);
          }
  
          String extension = "";
          int dotIndex = filename.lastIndexOf('.');
          if (dotIndex >= 0) {
              extension = filename.substring(dotIndex);
              filename = filename.substring(0, dotIndex);
          }
  
          int fileNumber = 0;
          while (!uniqueFile.createNewFile()) {
              fileNumber++;
              String numberedFilename = String.format("%s-%d%s", filename, fileNumber, extension);
              uniqueFile = new File(directory, numberedFilename);
          }
  
          return (uniqueFile);
      }