Modeling the tic-tac-toe game in java 8