title: Junit Testing void 2D array
body: <p>I'm just starting out with testing.</p>
  
  <p>The method I'm trying to test has no return value (void), but it creates a static 2D array (char[][]) in its own class, so from what I understand, that is its side effect.</p>
  
  <p>Here is some mock code:</p>
  
  <pre><code>public class MyClass{
  
      public static char[][] table;
  
      public void setTable(int rows, int columns, int number){
          board = new char[n][m];
          // more code that alters the table in a specific way, 
          // depending on the 3rd parameter
      }
  </code></pre>
  
  <p>Now for the testing, I was thinking of doing something like:</p>
  
  <pre><code>public class SetTableTest{
  
      @Test
      public void test(){
          MyClass test = new MyClass();
          assertArrayEquals(**********, test.table);
      }
  }
  </code></pre>
  
  <p>I have 2 questions:</p>
  
  <ol>
  <li><p>Am I allowed comparing to a static variable like I did (<code>test.table</code>) ie. will that actually return an "instance" of the completed table?</p></li>
  <li><p>I'm fairly certain that there's no <code>assertArrayEquals</code> equivalent for 2D arrays, so how do I go about this?</p></li>
  </ol>