// sort them first
IJavaCompletionProposal[] keyWordResults= collector.getKeywordCompletionProposals();
for (int i= 0; i < keyWordResults.length; i++) {
String keyword= keyWordResults[i].getDisplayString();
for (int k= 0; k < templateResults.length; k++) {
TemplateProposal curr= templateResults[k];
if (curr.getTemplate().getName().startsWith(keyword)) {
curr.setRelevance(keyWordResults[i].getRelevance() + 1);
}
}
}
// concatenate arrays