CharSequence (@NotNull List<? extends TokenInfo> tokens) { int size = 0; for (TokenInfo token : tokens) { size += token.getText().length(); } StringBuilder result = new StringBuilder(size); for (TokenInfo token : tokens) { result.append(token.getText()); } return result.toString(); }