title: Why getArgument() when using "doAnswer" in mockito 2 doesn't cast implicitly?
body: <p>So now I am migrating from Mockito 1.* to 2.* and I don't understand why there is a casting problem when using getArgument() in the doAnswer. I mean when I try to invoke getArgument() in the other method argument or i try to chain methods on the retrieved object.
  Here is code which worked with mockito 1.* </p>
  
  <pre><code> doAnswer(invocation -&gt; {
              try (InputStream inputStream = invocation.getArgumentAt(0, SomeResource.class).getResource().getInputStream()) {
                  IOUtils.copy(inputStream, invocation.getArgumentAt(1, OutputStream.class));
              }
          return null;
          }).when(mockedService).downloadFile(any(), any());
  </code></pre>
  
  <p>Changing getArgumentAt() to getArgument() after migration to 2.* failed, because "getResource()" method can't be found with a type. Also getting second argument from invocation didn't work because of incompatible type.</p>
  
  <pre><code>doAnswer(invocation -&gt; {
              try (InputStream inputStream = invocation.getArgument(0).getResource().getInputStream()) {
                  IOUtils.copy(inputStream, invocation.getArgument(1));
              }
          return null;
          }).when(mockedService).downloadFile(any(), any());
  </code></pre>
  
  <p>I had to change to explicit casting in second argument or explicitly save to new reference and the same for first.
  That code works: </p>
  
  <pre><code>doAnswer(invocation -&gt; {
      final SomeResource input = invocation.getArgument(0);
      final OutputStream outputStream = invocation.getArgument(1);
      try (InputStream inputStream = input.getResource().getInputStream()) {
          IOUtils.copy(inputStream, outputStream);
      }
      return null;
  }).when(mockedService).downloadFile(any(), any());
  </code></pre>
  
  <p>I don't know why.</p>