Extracted code samples from the Java ToDo Tutorial docs

Wasn't sure what do do with existing code samples that had the "..." at the end so have left those as is for now.