Mocking contains() with a String[][]
<p>I have two SQL tables. After grabbing both tables in <code>ResultSets</code>, I've stored them in <code>String[][]s</code>, ordered by a common id column. These tables should contain the same data, however one may have duplicates of the same row from the other. In order to check if every <code>String[]</code> in table A is present at least once in table B, I need to construct a somewhat efficient <code>contains()</code>-esque method for <code>String[]</code>.</p>

<p>This is what I have so far, but am stumped (also not sure if there's  a much more efficient solution). Give it the source table and target table. It takes each <code>String[]</code> in the source table and (should) go through each <code>String[]</code> in the target table and find an instance of the source <code>String[]</code> somewhere in the target <code>String[][]</code> by checking if there's at least one <code>String[]</code> that matches the original <code>String[]</code>, element by element. Can anyone point me in the right direction and/or fill in the blanks? This isn't homework or any assignment, I'm refactoring some code and am having a major brain fart. Thanks!</p>

<pre><code>    public boolean targetContainsSource(String[][] s, String[][] t) {
    boolean result = true;

    //For each String[] in String[][] s
    for (int i = 0; i &lt; s.length; i++) {

        //For each String[] in String[][] t
        for (int j = 0; j &lt; t.length; j++) {

            //For each String in t's String[]
            for (int k = 0; k &lt; t[0].length; k++) {
                if (!s[i][k].equals(t[j][k])) {

                }
            }
        }
    }

    return result;
}
</code></pre>
