I have a list which I transform using guava's Lists.transform function. Later, when I try to sort the list using Collections.sort(), I get an UnsupportedOperationException.
My code look's like this:
private List<SelectItemInfo> convertToSelectItemList(
final List<String> dataOwnersOfActiveQualifiers)
{
final List<SelectItemInfo> dataOwnersSelectItemList = transform(dataOwnersOfActiveQualifiers,
new Function<String, SelectItemInfo>()
{
public SelectItemInfo apply(final String input)
{
final Employee employee = getLdapQuery().findEmployeesByIdOrLogin(input);
return new SelectItemInfo(input, employee.toStringNameSurname());
}
});
Collections.sort(dataOwnersSelectItemList, this.comparator);
return dataOwnersSelectItemList;
}
I am not sure why I am getting this error.