Java practice using tdd