@Test public void testFindLiveNeighbourCount() { System.out.println("findLiveNeighbourCount"); Cell cell = new Cell(2,3); Set<Cell> liveCells = new HashSet<Cell>(); liveCells.add(new Cell(1,2)); liveCells.add(new Cell(2,2)); liveCells.add(new Cell(1,4)); liveCells.add(new Cell(3,4)); int expResult = 4; int result = FindLiveNeighbour.findLiveNeighbourCount(cell, liveCells); assertEquals(expResult, result); }
public static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells) { int count=0; for(Cell c:AbstractGameStratedgy.findNeighbours(cell, liveCells)) { if(State.LIVE.equals(c.getState())) count++; } return count; }
FindLiveNeighbour { public static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells) { int count=0; for(Cell c:AbstractGameStratedgy.findNeighbours(cell, liveCells)) { if(State.LIVE.equals(c.getState())) count++; } return count; } }
FindLiveNeighbour { public static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells) { int count=0; for(Cell c:AbstractGameStratedgy.findNeighbours(cell, liveCells)) { if(State.LIVE.equals(c.getState())) count++; } return count; }  }
FindLiveNeighbour { public static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells) { int count=0; for(Cell c:AbstractGameStratedgy.findNeighbours(cell, liveCells)) { if(State.LIVE.equals(c.getState())) count++; } return count; }  static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells); }
FindLiveNeighbour { public static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells) { int count=0; for(Cell c:AbstractGameStratedgy.findNeighbours(cell, liveCells)) { if(State.LIVE.equals(c.getState())) count++; } return count; }  static int findLiveNeighbourCount(Cell cell,Set<Cell> liveCells);  }