LookupElement (LookupElement[] items) { LookupElement best = items[0]; for (int i = 1; i < items.length; i++) { LookupElement item = items[i]; if (getPriority(best) < getPriority(item)) { best = item; } } return best; }