package gol.board;

import gol.Cell;
import org.junit.Assert;

import java.util.Arrays;
import java.util.Collection;
import java.util.Objects;

/**
 * Created by Tino on 19.01.2016.
 */
public abstract class CellTest {

    public void assertContainsAll(final Collection<Cell> collectionToTest, final Cell... expectedCells) {
        Objects.requireNonNull(collectionToTest, "Collection required");
        Objects.requireNonNull(expectedCells, "Cells required for assertion");

        for (Cell cellToTest : collectionToTest) {

            boolean cellFound = false;
            for (Cell expectedCell : expectedCells) {
                cellFound = cellFound || expectedCell.equals(cellToTest);
            }

            if (!cellFound) {
                Assert.fail("Not an expected Cell: " + cellToTest +
                        ", expected one of: " + Arrays.toString(expectedCells));
            }
        }
    }
}

@@ -476,103 +476,8 @@
 );%0A%0A
-        for (Cell cellToTest : collectionToTest) %7B%0A%0A            boolean cellFound = false;%0A    
     
@@ -514,32 +514,33 @@
 xpectedCells) %7B%0A
+%0A
                 
@@ -539,111 +539,52 @@
     
-    cellFound = cellFound %7C%7C expectedCell.equals(cellToTest);%0A            %7D%0A%0A            if (!cellFound
+if (!collectionToTest.contains(expectedCell)
 ) %7B%0A
@@ -616,14 +616,16 @@
 il(%22
-Not an
+Cell %22 +
  exp
@@ -633,75 +633,28 @@
 cted
- 
 Cell
-: %22 + cellToTest +%0A                        %22, expected one of:
+ + %22not found in
  %22 +

Simplify check