title: Using Mockito to mock a local variable of a method
body: <p>I have a class <code>A</code> that needs to the tested. The following is the definition of <code>A</code>:</p>
  
  <pre><code>public class A {
      public void methodOne(int argument) {
          //some operations
          methodTwo(int argument);
          //some operations
      }
  
      private void methodTwo(int argument) {
          DateTime dateTime = new DateTime();
          //use dateTime to perform some operations
      }
  }
  </code></pre>
  
  <p>And based on the <code>dateTime</code> value some data is to be manipulated, retrieved from the database. For this database, the values are persisted via a JSON file.</p>
  
  <p>This complicates things. What I need is to set the <code>dateTime</code> to some specific date while it is being tested. Is there a way I can mock a local variable's value using mockito?</p>