title: How to mock objects created inside method?
body: <p>Consider this</p>
  
  <pre><code>public class UserManager {
      private final CrudService crudService;
  
      @Inject
      public UserManager(@Nonnull final CrudService crudService) {
          this.crudService = crudService;
      }
  
      @Nonnull
      public List&lt;UserPresentation&gt; getUsersByState(@Nonnull final String state) {
          return UserPresentation.getUserPresentations(new UserQueries(crudService).getUserByState(state));
      }
  
  }
  </code></pre>
  
  <p>I want to mock out </p>
  
  <pre><code>new UserQueries(crudService)  
  </code></pre>
  
  <p>so that I can mock out its behavior</p>
  
  <p>Any ideas?</p>