code: public static <T extends Comparable<T>> boolean areNotInAscendingOrder(List<T> values) {
  
      int lastNotNull = -1;
      for (int i = 0; i < values.size(); i++) {
        T value = values.get(i);
  
        if (value != null) {
          if (lastNotNull != -1 && values.get(lastNotNull).compareTo(value) > 0) {
            return true;
          }
  
          lastNotNull = i;
        }
      }
  
      return false;
    }
docs: Checks if any of the values are not in an ascending order. The check is done based on the {@link Comparable#compareTo(Object)} method.
  
  E.g. if we have {@code minPriority = 10}, {@code priority = 13} and {@code maxPriority = 5} and
  {@code List<Integer> values = {minPriority, priority, maxPriority}}. Then a call to {@link CompareUtil#areNotInAscendingOrder(List values)}
  will return {@code true}
  
  @param values to validate
  @param <T> the type of the comparable
  @return {@code false} if the not null values are in an ascending order or all the values are null, {@code true} otherwise