ActionListUtil { public static List<WebFriendlyRecipient> getWebFriendlyRecipients(Collection<Recipient> recipients) { Collection<WebFriendlyRecipient> newRecipients = new ArrayList<WebFriendlyRecipient>(recipients.size()); for (Recipient recipient : recipients) { newRecipients.add(new WebFriendlyRecipient(recipient)); } List<WebFriendlyRecipient> recipientList = new ArrayList<WebFriendlyRecipient>(newRecipients); Collections.sort(recipientList, new Comparator<WebFriendlyRecipient>() { Comparator<String> comp = new ComparableComparator(); @Override public int compare(WebFriendlyRecipient o1, WebFriendlyRecipient o2) { return comp.compare(o1.getDisplayName().trim().toLowerCase(), o2.getDisplayName().trim().toLowerCase()); } }); return recipientList; } private  ActionListUtil(); static List<WebFriendlyRecipient> getWebFriendlyRecipients(Collection<Recipient> recipients);  }
@Test public void testGetWebFriendlyRecipientsWithGroup() { Collection<Recipient> recipients = new ArrayList<Recipient>(); recipients.add(new KimGroupRecipient(Group.Builder.create("KUALI", "testgroup", "1").build())); ActionListUtil.getWebFriendlyRecipients(recipients); }