Added in test case and refactored code samples for Java ToDo tutorial