title: How do I mock a method using EasyMock
body: <pre><code>User getUser(int id) {
      User user = service.get( id );
      if( user != null ) {
          user.Stuff = getUserStuff( id );
          return User;
      }
  
      throw new NotFoundException();
  }
  
  Stuff getUserStuff( int id ) {
      stuffGetter.getStuff( id ); // stuff getter makes a rest call
      return Stuff;
  }
  </code></pre>
  
  <p>Using EasyMock, how would i test the <code>getUser(id)</code> method. The confusing part for me is that <code>getUserStuff(id)</code> makes an external call which I dont want to make when testing <code>getUser</code>.</p>