Here you can find the source of equals(int[][] ar1, int[][] ar2)
public static boolean equals(int[][] ar1, int[][] ar2)
//package com.java2s; //License from project: Apache License import java.util.Arrays; import java.util.List; public class Main { public static boolean equals(int[][] ar1, int[][] ar2) { if (ar1.length != ar2.length) return false; for (int[] row1 : ar1) { if (!contains(row1, ar2)) { return false; }/* w w w .ja va2 s .com*/ } return true; } public static <T> boolean equals(List<List<T>> lists1, List<List<T>> lists2) { for (List<T> list1 : lists1) { if (!lists2.contains(list1)) { return false; } } return true; } public static boolean contains(int[] subject, int[][] list) { for (int[] row : list) { if (Arrays.equals(subject, row)) { return true; } } return false; } }