I am just curious on how people solve this. I often write the same type of code all the time. For instance:
new Thread() {
//...
//...
//...
//Change
If it is something that you use in many projects, I would set this up in your IDE. For instance I use eclipse and if you go to Window->Preferences->Java->Editor->Templates you can setup your own templates, and then have them auto complete. For instance I always start typing sysout and then press tab, and eclipse has a built in template to replace that with System.out.println();
There are many pre-built templates in eclipse, so you could look at those for examples on syntax, if that is the IDE you use, if not there may be something similiar in other IDE's
This is very useful, and you could create one for any boiler code you find yourself writing a lot.