@@ -0,0 +1,963 @@
+package test;%0A%0Aimport static org.junit.Assert.*;%0A%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.DataInputStream;%0Aimport java.io.DataOutputStream;%0Aimport java.io.IOException;%0A%0Aimport model.Level;%0Aimport model.Tile;%0A%0Aimport org.junit.Test;%0A%0A/**%0A * @author Eli Skeggs%0A */%0Apublic class TestLevel %7B%0A  @Test%0A  public void test() throws IOException %7B%0A    ByteArrayOutputStream out = new ByteArrayOutputStream();%0A    Level level = new Level();%0A    level.initialBoard.grid%5B0%5D%5B0%5D.tile = new Tile(5);%0A    level.write(new DataOutputStream(out));%0A%0A    byte%5B%5D data = out.toByteArray();%0A    Level copy = new Level(new DataInputStream(new ByteArrayInputStream(data)));%0A%0A    assertEquals(level, copy);%0A    assertEquals(5, copy.initialBoard.grid%5B0%5D%5B0%5D.tile.number);%0A    assertEquals(null, copy.initialBoard.grid%5B1%5D%5B0%5D.tile);%0A%0A    Level copyTwo = new Level(level);%0A    assertEquals(level, copyTwo);%0A    assertEquals(copy, copyTwo);%0A  %7D%0A%7D%0A

Test Level copying