Extracted code samples from the Java ToDo Tutorial docs