title: Mockito : Mocking and returning a different type value
body: <p>Is it possible to return a different type using when-return in mockito.</p>
  
  <p>my function </p>
  
  <pre><code>m.findDocument(id) 
  </code></pre>
  
  <p>returns a document based on <code>id</code> which I am converting to string for further processing.
  But, for testing I am fetching the string from a id file. So, effectively I want that string to be returned when the function is called like below :</p>
  
  <p><code>when(m.findDocument(id)).thenReturn('that_string_from_id_file');</code></p>
  
  <p>Since, one is of document type and other of String, is there way in mockito I can do the same ?</p>
  
  <p>Thanks</p>