### Question:
ListContainer extends AbstractContainer implements
        Container.Indexed, Container.Sortable, ItemSetChangeNotifier { @Override public void sort(Object[] propertyId, boolean[] ascending) { if (propertyId.length > 0) { if (backingList instanceof SortableLazyList) { SortableLazyList sll = (SortableLazyList) backingList; String[] stringProperties = new String[propertyId.length]; System.arraycopy(propertyId, 0, stringProperties, 0, propertyId.length); sll.setSortProperty(stringProperties); sll.setSortAscending(ascending); sll.reset(); } else { Comparator<T> comparator = new PropertyComparator(propertyId, ascending); Collections.sort(backingList, comparator); } fireItemSetChange(); } } ListContainer(Collection<? extends T> backingList);  ListContainer(Class<? extends T> type, Collection<? extends T> backingList);  ListContainer(Class<? extends T> type);  ListContainer(Class<? extends T> type, String... properties);  ListContainer(DynaClass type);  ListContainer(DynaClass type, String... properties); final void setCollection(Collection<? extends T> backingList1); @Override int indexOfId(Object itemId); int indexOf(T bean); @Override T getIdByIndex(int index); @Override List<T> getItemIds(int startIndex, int numberOfItems); @Override Object addItemAt(int index); @Override Item addItemAt(int index, Object newItemId); @Override T nextItemId(Object itemId); @Override T prevItemId(Object itemId); @Override T firstItemId(); @Override T lastItemId(); @Override boolean isFirstId(Object itemId); @Override boolean isLastId(Object itemId); @Override Object addItemAfter(Object previousItemId); @Override Item addItemAfter(Object previousItemId, Object newItemId); @Override Item getItem(Object itemId); @Override Collection<String> getContainerPropertyIds(); @Override Collection<?> getItemIds(); @Override Property getContainerProperty(Object itemId, Object propertyId); @Override Class<?> getType(Object propertyId); static Class<?> getNestedPropertyType(DynaClass bean, String name); @Override int size(); @Override boolean containsId(Object itemId); @Override Item addItem(Object itemId); @Override Object addItem(); @Override boolean removeItem(Object itemId); @Override boolean addContainerProperty(Object propertyId,
            Class<?> type, Object defaultValue); @Override boolean removeContainerProperty(Object propertyId); @Override boolean removeAllItems(); ListContainer addAll(Collection<T> beans); @Override void sort(Object[] propertyId, boolean[] ascending); @Override Collection<?> getSortableContainerPropertyIds(); @Override void addItemSetChangeListener(
            Container.ItemSetChangeListener listener); @Override void removeItemSetChangeListener(
            Container.ItemSetChangeListener listener); @Override void addListener(Container.ItemSetChangeListener listener); @Override void removeListener(Container.ItemSetChangeListener listener); void setContainerPropertyIds(String... properties); @Override void fireItemSetChange();  }### Answer:
@Test public void testSort() { ListContainer<Person> lc = new ListContainer<>(Service.getListOfPersons(100)); lc.sort(new Object[] {"age","firstName"}, new boolean[] {true, false}); List<Person> sortedList = lc.getBackingList(); for (int i=0; i<sortedList.size()-1; i++) { Person a = sortedList.get(i); Person b = sortedList.get(i+1); int ageCompare = a.getAge().compareTo(b.getAge()); assertTrue(ageCompare <= 0); if (ageCompare == 0) { int nameCompare = a.getFirstName().compareTo(b.getFirstName()); assertTrue(nameCompare >= 0); } } }