class Game {

	public int move(char player) {
		for (int i = 0; i < 9; i++) {
			if (board.charAt(i) == '-') {
				Game game = play(i, player);
				if (game.winner() == player) 
					return i;
			}
		}

		for (int i = 0; i < 9; i++) {
			if (board.charAt(i) == '-') 
				return i;
		}	
		return -1;
	}

}

class GameTest {

	@Test
	public void testFindWinningMove() {

		Game game = new Game("XO-XX-OOX");
		assertEquals(5, game.move('X'));
	}

}