title: Set value to mocked object but get null
body: <p>I have a simple class <code>Foo</code> to be mocked:</p>
  
  <pre><code>public class Foo {
     private String name;
     public Foo() {
     }
     public Foo(String name) {
       this.name = name;
     }
  
     public void setName(String name) {
       this.name = name;
     }
     public String getName() {
       return name;
     }
  }
  </code></pre>
  
  <p>In my unit test code, I mock it by using <a href="http://mockito.org/" rel="noreferrer">Mockito</a>.</p>
  
  <pre><code>Foo mockedFoo = Mockito.mock(Foo.class);
  mockedFoo.setName("test");
  // name is null
  String name = mockedFoo.getName();
  </code></pre>
  
  <p>I set <code>name</code> in mocked object, but when I call getter to get the name it returns <strong>null</strong>. </p>
  
  <p>Is it a Mockito specific issue or is it an convention that mocked object can't set value? Why is that? What is happening underneath with mocked object?</p>