title: How to mock a method call within a method for which i am writing junit test
body: <p>Could someone help me with mocking a method call within a method</p>
  
  <p>my code is like :</p>
  
  <pre><code>public class Service {
      public List&lt;Bean&gt; Filter(Bean bean){
          List&lt;Bean&gt; Filtered_List = getUtilityService.getBeanList();
          //Do something
          return beanList;
      }
  }
  </code></pre>
  
  <p>Now i want to write test case for Service class . How can i mock :
  List Filtered_List = getUtilityService.getBeanList(); and set values in it.</p>