@@ -0,0 +1,954 @@
+package com.alexrnl.commons.utils;%0A%0Aimport java.util.Iterator;%0Aimport java.util.Objects;%0Aimport java.util.logging.Logger;%0A%0A/**%0A * Utilities on collections.%3Cbr /%3E%0A * @author Alex%0A */%0Apublic final class CollectionUtils %7B%0A%09/** Logger */%0A%09private static Logger%09lg%09= Logger.getLogger(CollectionUtils.class.getName());%0A%09%0A%09/**%0A%09 * Constructor #1.%3Cbr /%3E%0A%09 * Default private constructor.%0A%09 */%0A%09private CollectionUtils () %7B%0A%09%09super();%0A%09%7D%0A%09%0A%09/**%0A%09 * Check if a collection is sorted.%3Cbr /%3E%0A%09 * @param collection%0A%09 *        the collection to check.%0A%09 * @return %3Ccode%3Etrue%3C/code%3E if the collection is sorted.%0A%09 */%0A%09public static %3CT extends Comparable%3C? super T%3E%3E boolean isSorted (final Iterable%3CT%3E collection) %7B%0A%09%09Objects.requireNonNull(collection);%0A%09%09final Iterator%3CT%3E it = collection.iterator();%0A%09%09%0A%09%09while (it.hasNext()) %7B%0A%09%09%09final T current = it.next();%0A%09%09%09if (it.hasNext() && current.compareTo(it.next()) %3E 0) %7B%0A%09%09%09%09return false;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09%0A%09%09return true;%0A%09%7D%0A%7D%0A

Add a new CollectionUtils class with a unique method to check if the map is properly ordered