code: public static char[] sequenceToArray(CharSequence seq) {
      if (seq == null) {
        throw new NullPointerException("CharSequence can't be NULL");
      }
      char[] chars = new char[seq.length()];
      for (int i = 0; i < seq.length(); i++) {
        chars[i] = seq.charAt(i);
      }
      return chars;
    }
docs: Utility method to converter {@link CharSequence} to char array
  
  @param seq Given sequence object
  @return An array that has same content