Is it possible to implement an adapter capable to intercept all inner method invocations inside main method? If we have this class...
class Zombie {
private Grave grave = new Grave();
public void kill(Integer zombieId) {
grave.dig(zombieId);
grave.put(zombieId);
}
}
installing the listener for "kill" method would intercept call for "dig" and "put" methods of a "Grave" class. If this is possible, some code would be great too.
Thanks.