public final class CollectionUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends java.lang.Comparable<? super T>> |
sortIfNotEmpty(java.util.List<T> list)
Sort a collection if it is not empty (to prevent
ConcurrentModificationException if an immutable
empty list that has been returned more than once is being sorted in one thread and iterated through in
another thread -- #334). |
static <T> void |
sortIfNotEmpty(java.util.List<T> list,
java.util.Comparator<? super T> comparator)
Sort a collection if it is not empty (to prevent
ConcurrentModificationException if an immutable
empty list that has been returned more than once is being sorted in one thread and iterated through in
another thread -- #334). |
public static <T extends java.lang.Comparable<? super T>> void sortIfNotEmpty(java.util.List<T> list)
ConcurrentModificationException if an immutable
empty list that has been returned more than once is being sorted in one thread and iterated through in
another thread -- #334).T - the element typelist - the listpublic static <T> void sortIfNotEmpty(java.util.List<T> list,
java.util.Comparator<? super T> comparator)
ConcurrentModificationException if an immutable
empty list that has been returned more than once is being sorted in one thread and iterated through in
another thread -- #334).T - the element typelist - the listcomparator - the comparator