I have this code
Foo foo = new Foo();
foo.callTheMethod();
Is there any way I can intercept the Foo.callTheMethod() call without subclassing or modifying Foo class, and without having a Foo factory?
EDIT: sorry forgot to mention this is on Android platform.
Have you considered aspect-oriented-programming and perhaps AspectJ ? See here and here for AspectJ/Android info.