title: Why to cast a list in another list
body: <p>I have a method in Spring Data JPA which returns a type of list.</p>
  
  <pre><code>List&lt;ModuleAccessEntity&gt; findByNameNotIgnoreCase(String moduleName);
  </code></pre>
  
  <p>Now on ServicesImplimentation.
  This list is transferred to another list.</p>
  
  <pre><code>moduleAccessEntity=(List&lt;ModuleAccessEntity&gt;) moduleAccessRepository.findByNameNotIgnoreCase("self");
  </code></pre>
  
  <p>here moduleAccessEntity also is list of type.</p>
  
  <pre><code>List&lt;ModuleAccessEntity&gt; moduleAccessEntity ;
  </code></pre>
  
  <p>I don't understand why is there a need of putting list in two more lists when we are already getting a list. Can't we do this in easy way like.</p>
  
  <pre><code>moduleAccessEntity= moduleAccessRepository.findByNameNotIgnoreCase("self");
  </code></pre>