title: EasyMock expect method is always return null despite setting a new Object in .andReturn
body: <p>I have my source code as:</p>
  
  <pre><code>response = getRequestService().retrieveResponse(baseRequest);  
  data = response.getStoredData(); ---&gt; (1)
  </code></pre>
  
  <p>And I have written my Test Case as :</p>
  
  <pre><code>RequestService requestService = EasyMock.createNiceMock(RequestService .class);  
  BaseRequest baseRequest = new BaseRequest();  
  BaseResponse response = new BaseResponse();  
  expect(requestService .retrieveResponse(EasyMock.eq(baseRequest))).andReturn(response)
  replay(requestService );  
  </code></pre>
  
  <p>However, when I run my test I am always getting a <code>NullPointerException</code> at line 1.</p>
  
  <p>Can somebody please help me on how to resolve this?</p>
  
  <p>Thanks.</p>