Returns a list of passive members.

@param comparator A comparator with which to sort the members list.
@return The sorted members list.
188392
public List<RaftMemberContext> getPassiveMemberStates(Comparator<RaftMemberContext> comparator) {
    List<RaftMemberContext> passiveMembers = new ArrayList<>(getPassiveMemberStates());
    passiveMembers.sort(comparator);
    return passiveMembers;
  }
546622
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
    {
        return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
    }
1003083
public Comparator<S> comparator() {
        if (mChunkMatcher == null) {
            return mChunkSorter;
        }
        return new Comparator<S>() {
            public int compare(S a, S b) {
                int result = mChunkMatcher.compare(a, b);
                if (result == 0) {
                    result = mChunkSorter.compare(a, b);
                }
                return result;
            }
        };
    }
8218
@CheckResult
    @NonNull
    public final Data<T> sort(@NonNull Comparator<? super T> comparator) {
        return new SortData<>(this, comparator);
    }
544370
public Collection<AsteriskQueueMember> getMembers()
    {
        List<AsteriskQueueMember> listOfMembers = new ArrayList<>(members.size());
        synchronized (members)
        {
            listOfMembers.addAll(members.values());
        }
        return listOfMembers;
    }
1222055
public static WritableComparator get(Class<? extends WritableComparable> c) {
        WritableComparator comparator = comparators.get(c);
        if (comparator == null) {
            // force the static initializers to run
            forceInit(c);
            // look to see if it is defined now
            comparator = comparators.get(c);
            // if not, use the generic one
            if (comparator == null) {
                comparator = new WritableComparator(c, true);
            }
        }
        return comparator;
    }
401000
public static <T> ItemsSketch<T> getInstance(final Comparator<? super T> comparator) {
    return getInstance(PreambleUtil.DEFAULT_K, comparator);
  }
1338371
public List<String> getMembers() {
    List<String> allList = new ArrayList<String>();
    allList.addAll(members);

    return Collections.unmodifiableList(allList);
  }
501993
public void addComparator(Comparator<T> comparator, boolean ascending) {
		this.comparators.add(new InvertibleComparator<T>(comparator, ascending));
	}
604550
public static <T> List<T> sort(List<T> list, Comparator<? super T> c) {
		Collections.sort(list, c);
		return list;
	}
1309642
private <K, V> List<Map.Entry<K, V>> sortedEntryList(Map<K, V> obj) {
        List<Map.Entry<K, V>> entryList = new ArrayList<Map.Entry<K, V>>(obj.entrySet());

        Collections.sort(entryList, new Comparator<Map.Entry<K, V>>() {
            @Override
            @SuppressWarnings({ "unchecked", "rawtypes" })
            public int compare(Entry<K, V> o1, Entry<K, V> o2) {
                K k1 = o1.getKey();
                K k2 = o2.getKey();

                if (k1 instanceof Comparable) {
                    return ((Comparable) k1).compareTo(k2);
                }

                return k1.hashCode() - k2.hashCode();
            }
        });

        return entryList;
    }
537558
public void sortReverse(final Comparator<T> comparator) {
    this.sort(comparator);
    for (int i = 0; i < this.size / 2; i++) {
      final T temp = this.elements[i];
      this.elements[i] = this.elements[this.size - i - 1];
      this.elements[this.size - i - 1] = temp;
    }
  }
609229
public static <V> V[] sort(V[] array, Comparator<? super V> comparator) {
        Arrays.sort(array, comparator);
        return array;
    }
1156431
public static <T extends Comparable<? super T>> void sort (List<T> a)
    {
        sort(a, new Comparator<T>() {
            public int compare (T o1, T o2) {
                if (o1 == o2) { // catches null == null
                    return 0;
                } else if (o1 == null) {
                    return 1;
                } else if (o2 == null) {
                    return -1;
                }
                return o1.compareTo(o2); // null-free
            }
        });
    }
810415
public function sorted(callable $comparator = null): Map
    {
        $copy = $this->copy();
        $copy->sort($comparator);
        return $copy;
    }
421350
public static String joinBySeparator( List<String> items, String separator ) {
        int size = items.size();
        if (size == 0) {
            return "";
        }
        StringBuilder sb = new StringBuilder(items.get(0));
        for( int i = 1; i < size; i++ ) {
            sb.append(separator).append(items.get(i));
        }
        return sb.toString();
    }
968207
public static <T> List<T> sort(Collection<T> collection, Comparator<? super T> comparator) {
		List<T> list = new ArrayList<T>(collection);
		Collections.sort(list, comparator);
		return list;
	}