title: How to treat opposite edges of a java array as if they're adjacent
body: <p>I have an 2D array in java 
  (example)</p>
  
  <pre><code>0|0|0|0
  1|1|1|0
  0|1|0|1
  </code></pre>
  
  <p>I need to create code that says if the items around the square are something, do something. I can do this however I have an issue.</p>
  
  <p>If the item is on an edge the array needs to effectively wrap, so that the top row is next to the bottom row.</p>
  
  <p>Does anyone know how to do this?</p>