docs: public static String replaceExtension(String path, String newExtension) throws IllegalArgumentException
    {
      Params.notNull(path, "Path");
      Params.notNull(newExtension, "New extension");
  
      if(newExtension.charAt(0) == '.') {
        newExtension = newExtension.substring(1);
      }
  
      int extensionDotIndex = path.lastIndexOf('.') + 1;
      if(extensionDotIndex == 0) {
        extensionDotIndex = path.length();
      }
      StringBuilder sb = new StringBuilder(path.length());
      sb.append(path.substring(0, extensionDotIndex));
      sb.append(newExtension);
      return sb.toString();
    }