Question: how to do tdd in java?
Answer: Firstly, add a test. Run all the tests and see if any new test fails. Update the code to make it pass the new tests. Run the test again and if they fail then refactor again and repeat.