code: public static void repeat(StringBuilder sb, String str, int count) {
          for (int i = 0; i < count; i++) {
              sb.append(str);
          }
      }
docs: Repeats string of characters a defined number of times, and appends result to StringBuilder.
  
  @param sb StringBuilder to append result to
  @param str string of characters to be repeated.
  @param count number of times to repeat, zero or a negative number produces no result