code: public static String createSequence(char c, int length) {
          if (length < 0) length = 1;
  
          StringBuffer buf = new StringBuffer(length);
          for (; length > 0; length--) {
              buf.append(c);
          }
          return buf.toString();
      }
docs: Creates and returns a String containing a sequence of the specified
  length, repeating the given character.