Java implementation of TicTacToe