title: Java: How to get the caller function name
body: <p>To fix a test case I need to identify whether the function is called from a particular caller function. I can't afford to add a boolean parameter because it would break the interfaces defined. How to go about this?</p>
  
  <p>This is what I want to achieve. Here I can't change the parameters of operation() as it is an interface implementation.</p>
  
  <pre><code>operation()
  {
     if not called from performancetest() method
         do expensive bookkeeping operation
     ...       
  
  }
  </code></pre>