title: Mockito with local variables
body: <p>I have a simple method that returns a <code>String</code>.</p>
  
  <p>It also creates a local <code>List</code>. I want to test the value added to the local <code>List</code>.</p>
  
  <p>Here is an example</p>
  
  <pre><code>package com.impl;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import com.test.domain.CustomerVo;
  
  public class ClassImpl {
  
      public String assignGift(CustomerVo customerVo) {
          List&lt;String&gt; listOfGift = new ArrayList&lt;String&gt;();
  
          if (customerVo.getName().equals("Joe")) {
              listOfGift.add("ball");
          } else if ((customerVo.getName().equals("Terry"))) {
              listOfGift.add("car");
          } else if (customerVo.getName().equals("Merry")) {
              listOfGift.add("tv");
          }else {
              listOfGift.add("no gift");
          }
  
          return "dummyString";
      }
  }
  </code></pre>
  
  <p>How can I test that when the <code>customerVo.getName.equals("Terry")</code>, <code>car</code> is added to the local <code>List</code>.</p>