Java Code with Tdd for 1st pattern