title: How to count method calls by instance
body: <p>I have following Code.</p>
  
  <pre><code>public interface Animal{
  
      void eat();
  }
  
  public class Lion implements Animal{
  
      @Override
      public void eat() {
          System.out.println("Lion can eat");
      }
      public static void main(String[] args) {
  
          Animal lion = new Lion();
          lion.eat();
          lion.eat();
          lion.eat();
      }
  }
  </code></pre>
  
  <p>as you can see I am calling <code>eat()</code> thrice. How can I calculate how many times it is called?</p>
  
  <p>Note that,
  you can not modify <code>eat()</code> method from class <code>Lion</code></p>