code: public static String createString( final char charToRepeat,
                                         int numberOfRepeats ) {
          assert numberOfRepeats >= 0;
          StringBuilder sb = new StringBuilder();
          for (int i = 0; i < numberOfRepeats; ++i) {
              sb.append(charToRepeat);
          }
          return sb.toString();
      }
docs: Create a new string containing the specified character repeated a specific number of times.
  
  @param charToRepeat the character to repeat
  @param numberOfRepeats the number of times the character is to repeat in the result; must be greater than 0
  @return the resulting string