Java tutorial
import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class Main { public static void main(String args[]) { List<String[]> left = new ArrayList<String[]>(); left.add(new String[] { "one", "two" }); List<String[]> right = new ArrayList<String[]>(); right.add(new String[] { "one", "two" }); java.util.Iterator<String[]> leftIterator = left.iterator(); java.util.Iterator<String[]> rightIterator = right.iterator(); if (left.size() != right.size()) { System.out.println("not equal"); } while (leftIterator.hasNext()) { if (Arrays.equals(leftIterator.next(), rightIterator.next())) continue; else { System.out.print("not equal"); break; } } } }