[java] make nextTurn and undoTurn private