code: @SuppressWarnings({ "unchecked", "rawtypes" })
      public <T> void sort(List<T> list, boolean reverse) {
          Class<?> type = getObjectClass(list);
          if (Comparable.class.isAssignableFrom(type)) {
              if (reverse) {
                  Collections.sort(list, Collections.reverseOrder());
              }
              else { Collections.sort((List) list); }
          }
          else {
              if (reverse) {
                  Collections.sort(list, TOSTRING_COMPARATOR_DESC);
              }
              else {
                  Collections.sort(list, TOSTRING_COMPARATOR_ASC);
              }
          }
      }
docs: Sort the given list according to either the natural ordering of the
  elements in the list or using a generic string comparison by converting
  each element to its string format via {@link Object#toString() toString}.
  If all elements in the list are {@link Comparable comparable}, then the
  natural ordering will be used. Otherwise, the generic comparison will be
  performed.
  
  @param list The list to sort
  @param reverse The state of whether to reverse the sort