code: public static String extend(String text, char filler, int length) {
          if (text.length() < length) {
              char[] buffer = new char[length];
              Arrays.fill(buffer, 0, length, filler);
              System.arraycopy(text.toCharArray(), 0, buffer, 0, text.length());
              return new String(buffer);
          } else {
              return text;
          }
      }
docs: Extends a string to have at least the given length. If the original string is already as long, it is returned
  without modification.
  
  @param text - a text string
  @param filler - the filler character
  @param length - the specified length
  @return the extended string