code: public static File addExtension(final File f, final String extension) {
      checkNotNull(f);
      checkNotNull(extension);
      Preconditions.checkArgument(!extension.isEmpty());
      Preconditions.checkArgument(!f.isDirectory());
  
      final String absolutePath = f.getAbsolutePath();
      return new File(absolutePath + "." + extension);
    }
docs: Derives one {@link File} from another by adding the provided extension.
  The extension will be separated from the base file name by a ".".