Explanation:
[ol]
[li]Set our keywordChoices ($keywordChoices)[/li][li]Set up a list ($sort)[/li][li]Iterate through the ArrayList ($keywordChoices)[/li][li]Set up a map object ($sortItem)[/li][li]Set up name and value properties ($sortItem.name $sortItem.value)[/li][li]Add map object to list ($sort.add($sortItem))[/li][li]Iterate through $tools.sorter.sort($sort,“name:desc”)[/li][li]Access properties through $sortItem.name.toString()[/li][/ol]
This could be a Java Extension to save time. I’m also looking for a better process.