ConnectFourState extends TwoDimensionalBoardGameState { @Override public boolean endState() { int check = EMPTY; for(int i = 0; i < WIDTH; i++){ for(int j = 0; j < HEIGHT; j++){ if(boardState[i][j] == EMPTY){ continue; }else{ for(int dX = -1; dX <= 1; dX++){ for(int dY = -1; dY <=1; dY++){ if(dX != 0 && dY != 0 && boardState[i][j] != EMPTY){ int numInRow = 0; check = boardState[i][j]; int x = i; int y = j; do{ x = i + dX; y = j + dY; if(((x >= 0 && x < WIDTH) && (y >= 0 && y < HEIGHT)) && boardState[x][y] == check) numInRow++; }while(((x >= 0 && x < WIDTH) && (y >= 0 && y < HEIGHT)) && boardState[x][y] == check || numInRow < 4); if(numInRow >= 4){ return true; } } check = EMPTY; } } } } } Set<ConnectFourState> poss = possibleBoardGameStates(this); if(poss.size() == 0){ winners.add(BLACK_CHECK); winners.add(RED_CHECK); return true; } return false; } ConnectFourState();  ConnectFourState(ConnectFourState state);  ConnectFourState(int[][] board, int nextPlay, List<Integer> win); @Override boolean endState(); @SuppressWarnings("unchecked") @Override Set<T> possibleBoardGameStates(T currentState); @SuppressWarnings("unchecked") @Override T copy(); @Override List<Integer> getWinners(); @Override void setupStartingBoard(); @Override int getBoardWidth(); @Override int getBoardHeight(); @Override char[] getPlayerSymbols(); @Override Color[] getPlayerColors(); @Override boolean moveOnePiece(); @Override boolean moveSinglePoint(Point goTo); @Override boolean moveDoublePoint(Point goTo, Point moveTo);  }
@Test public void testEndState() { fail("Not Yet Implemented"); }