I'm in the process of creating exercises in how to write a plug-in to a system integration tool. We will have the correct answers implemented for demonstration after exercises, but the students will receive source where some methods are empty and just have a comment with a TODO in them describing what they should do.
To avoid duplication, it would be nice if the students' versions could be generated from the compilable and correct answer source-files. It struck me that the Java Annotation Processing Tool (that APT, not the debian APT) could possibly be used to generate the exercises, to have APT spit out methods as empty if the input method carries an annotation to do so.
Is this possible to do using APT? If so, how would one do it?
Are there better/easier ways to avoid having duplication, to generate the exercises and correct answers from a single source, that I am overlooking?