title: Mock a Method with complex type
body: <p>While mocking a method, which have complex type, returning <code>null</code> in java</p>
  
  <pre><code>public void sendRequest(OnlineRequest request) {
          OnlineResponse response = client.handleRequest(request);
          System.out.println( response);
  }
  </code></pre>
  
  <pre><code>Mockito.when(client.handleRequest(request)).thenReturn(new OnlineResponse());
  </code></pre>