title: Mocked method returns null instead of expected
body: <p>I would like to use Mockito for testing EJB. The <code>get()</code> method returns with the result of a database query and the <code>transformedGet()</code> does the business logic in the session bean. </p>
  
  <p>If the <code>mockFoo.get()</code> is called directly, it works as expected.
  But when the <code>mockFoo.transformedGet()</code> calls the <code>get()</code> method it returns with null, instead of the expected value. </p>
  
  <p>I would like to test the business logic, and isolate the database query. Is it possible to do this with Mockito? </p>
  
  <p>Class to test:</p>
  
  <pre><code>public class Foo {
      public String get() {
           return "get";
      }
  
      public String transformedGet() {
          return "transformed" + get();
      }
  }
  </code></pre>
  
  <p>The test:</p>
  
  <pre><code>@Test
  public void mockitoTest() {
      Foo mockFoo = Mockito.mock(Foo.class);
      String expected = "test";
  
      Mockito.when(mockFoo.get()).thenReturn(expected);
  
      String actual = mockFoo.get();
      Assert.assertEquals(actual, expected);
      String transformed = mockFoo.transformedGet();
      Assert.assertEquals(transformed, "transformed" + expected);
  }
  </code></pre>