@Override
	public List<AutoCompleteItem> search(String wordPart, List<AutoCompleteItem> items)
	{
		wordPart = wordPart.toLowerCase();
		if (wordPart.trim().isEmpty())
			return items;

		List<AutoCompleteItem> retVal = new ArrayList<AutoCompleteItem>();
		SimpleAutoCompleteItem item = new SimpleAutoCompleteItem(wordPart);
		int searchIndex = Collections.binarySearch(items, item, new Comparator<AutoCompleteItem>()
		{
			@Override
			public int compare(AutoCompleteItem listItem, AutoCompleteItem item)
			{
				boolean match = listItem.getAutoCompleteId().toLowerCase().startsWith(item.getAutoCompleteId().toLowerCase());
				return match ? 0 : listItem.getAutoCompleteId().toLowerCase().compareTo(item.getAutoCompleteId().toLowerCase());
			}
		});
		if (searchIndex < 0)
			return retVal;
		AutoCompleteItem possibleMatch = items.get(searchIndex);
		if (possibleMatch.getAutoCompleteId().toLowerCase().startsWith(wordPart))
		{

			while (searchIndex >= 0 && items.get(searchIndex).getAutoCompleteId().toLowerCase().startsWith(wordPart))
				searchIndex--;
			searchIndex++;
			while (searchIndex < items.size()
				   && items.get(searchIndex).getAutoCompleteId().toLowerCase().startsWith(wordPart))
			{
				retVal.add(items.get(searchIndex));
				searchIndex++;
			}
		}
		return retVal;
	}