Highly repetitive code is generally a bad thing, and there are design patterns that can help minimize this. However, sometimes it\'s simply inevitable due to the constraints
You could use a code generator to construct variations of the code using a template. In that case, the java source is a product of the generator and the real code is the template.