Extracted some code samples from the Java ToDo Tutorial docs