public List<String> tokenize(boolean omitEmptyStringAtEnd) {
        List<String> output = new ArrayList<>();
        while (hasNext()) {
            output.add(readString());
        }
        if (!omitEmptyStringAtEnd && this.cursor > 0 && isWhitespace(peek(-1))) {
            output.add("");
        }
        return output;
    }
Tokenizes strings on whitespace, but ignoring whitespace enclosed within quotes.
common/src/main/java/me/lucko/luckperms/common/command/utils/QuotedStringTokenizer.java