Cell { public boolean couldBePartOfShip() { return symbol == 'X'; } Cell(char symbol, int row, int column); boolean isValidCell(); boolean isPartOfShip(); void setIsPartOfShip(boolean isPartOfShip); Cell getLeft(); Cell getRight(); Cell getUp(); Cell getDown(); void setLeft(Cell left); void setRight(Cell right); void setUp(Cell up); void setDown(Cell down); boolean isAdjacentToShip(); boolean couldBePartOfShip(); boolean isVisited(); void setVisited(boolean visited);  }
@Test public void a_cell_should_know_if_itself_could_be_a_part_of_a_ship() throws Exception { Cell cell = new Cell('.', 1, 1); assertFalse(cell.couldBePartOfShip()); cell = new Cell('X', 1, 1); assertTrue(cell.couldBePartOfShip()); }