// Get all the country names
Collection allCountries = CountryCollection.getAllCountries();
// Start to build the suggestions list
ArrayList suggestions = new ArrayList();
if (in_word != null && in_word.length() > 0)
{
Iterator iter = allCountries.iterator();
while(iter.hasNext())
{
String currentWord = (String) iter.next();
if(currentWord.toLowerCase().startsWith(in_word.toLowerCase()))
suggestions.add(currentWord);
}
}
return suggestions;