private CompletionToken[] createTokensFromNodes(int offset, int startPos, List<Node> nodes) {
Collections.sort(nodes, NODE_ORDER);
CompletionToken[] tokens = new CompletionToken[nodes.size()];
int n = 0;
for (Node node : nodes) {
CompletionToken t = createToken(offset, startPos, node);
tokens[n] = t;
++n;
}
return tokens;
}