I have to handle two classes with identical methods but they don\'t implement the same interface, nor do they extend the same superclass. I\'m not able / not allowed to change t
You probably can exploit a facade along with the reflection - In my opinion it streamlines the way you access the legacy and is scalable too !
class facade{ public static getSomething(Object AorB){ Class c = AorB.getClass(); Method m = c.getMethod("getValueOne"); m.invoke(AorB); } ... }