code: public static String getSpaces(int length) {
          char[] charArray = new char[length];
          Arrays.fill(charArray, ' ');
          String str = new String(charArray);
          return str;
      }
docs: Generates a string with {@code length} spaces.
  
  @param length length of the string
  @return the string