Implementing the logic of a simple tennis game(java)