int (int @NotNull [] obj1, int @NotNull [] obj2) { for (int i = 0; i < Math.min(obj1.length, obj2.length); i++) { int res = Integer.compare(obj1[i], obj2[i]); if (res != 0) return res; } return Integer.compare(obj1.length, obj2.length); }