code: public static <T extends Comparable<T>> int compareArrays(T[] first, T[] second) {
      List<T> firstAsList = Arrays.asList(first);
      List<T> secondAsList = Arrays.asList(second);
      return CollectionUtils.compareLists(firstAsList, secondAsList);
    }
docs: Provides a consistent ordering over arrays. First compares by the
  first element. If that element is equal, the next element is
  considered, and so on. This is the array version of
  {@link edu.stanford.nlp.util.CollectionUtils#compareLists}
  and uses the same logic when the arrays are of different lengths.