Here you can find the source of arrayCompare(final T[] a, final T[] b)
public static final <T extends Object & Comparable<? super T>> int arrayCompare(final T[] a, final T[] b)
//package com.java2s; // This package is part of the Spiralcraft project and is licensed under public class Main { public static final <T extends Object & Comparable<? super T>> int arrayCompare(final T[] a, final T[] b) { // Supress unchecked generics- we're in meta-land here if (a == b) { return 0; }/*from w ww .j av a 2 s . com*/ if (a == null && b != null) { return -1; } if (b == null && a != null) { return 1; } for (int i = 0; i < a.length; i++) { if (i == b.length) { return 1; } if (a[i] != b[i]) { if (a[i] == null && b[i] != null) { return -1; } if (b[i] == null && a[i] != null) { return 1; } int result = a[i].compareTo(b[i]); if (result != 0) { return result; } } } if (b.length > a.length) { return -1; } return 0; } }