code: public static void createNewFile(@NonNull final File file, final boolean overwrite)
              throws IOException {
          Condition.INSTANCE.ensureNotNull(file, "The file may not be null");
          boolean result = file.createNewFile();
  
          if (!result) {
              if (overwrite) {
                  try {
                      delete(file);
                      createNewFile(file, false);
                  } catch (IOException e) {
                      throw new IOException("Failed to overwrite file \"" + file + "\"");
                  }
              } else if (file.exists()) {
                  throw new IOException("File \"" + file + "\" does already exist");
              } else {
                  throw new IllegalArgumentException("The file must not be a directory");
              }
          }
      }
docs: Creates a new, empty file.
  
  @param file
  The file, which should be created, as an instance of the class {@link File}. The file
  may not be null. If the file is a directory, an {@link IllegalArgumentException} will
  be thrown
  @param overwrite
  True, if the file should be overwritten, if it does already exist, false otherwise
  @throws IOException
  The exception, which is thrown, if an error occurs while creating the file