code: public static String collectChar(String string, CharToCharFunction function)
      {
          int size = string.length();
          StringBuilder builder = new StringBuilder(size);
          for (int i = 0; i < size; i++)
          {
              builder.append(function.valueOf(string.charAt(i)));
          }
          return builder.toString();
      }
docs: Transform the char elements to a new string using the specified function {@code function}.
  
  @since 7.0