I\'m working on a problem where there are several implementations of Foo, accompanied by several FooBuilder\'s. While Foo\'s share sev
Foo
FooBuilder
Generics might be the way to go here.
If you declare setA() something like this (pseudo-code)
T setA(int a)
the compiler should be able to figure out the real types, and if it doesn't you can give hints in the code like
obj.setA(42)