ConnectFourState extends TwoDimensionalBoardGameState { @SuppressWarnings("unchecked") @Override public <T extends BoardGameState> Set<T> possibleBoardGameStates(T currentState) { Set<T> poss = new HashSet<T>(); for(int i = 0; i < WIDTH; i++){ ConnectFourState temp = this.copy(); if(boardState[i][0] == EMPTY){ temp.moveSinglePoint(new Point(i, 0)); poss.add((T) temp); } } return poss; } 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 testPossibleBoardGameStates() { Set<ConnectFourState> startSet = start.possibleBoardGameStates(start); List<ConnectFourState> startList = new ArrayList<ConnectFourState>(); for(int i = 0; i < start.getBoardWidth(); i++){ ConnectFourState temp = start.copy(); temp.moveSinglePoint(new Point(i, 0)); startList.add(temp); } for(ConnectFourState bgs : startSet){ assertTrue(startList.contains(bgs)); } }