title: print the contents of list along with the sublist using spring mvc
body: <p>how to 
  Print the contents of list along with the subList.? can someone help me how to complete service class logic?
  question was below Create a program for netplay as below.
      Main List - Categories
      Category sub list - Courses</p>
  
  <pre><code>Categories Sample Data: (Add first 3 categories from the netplay app)
   "id": 1001,
   "name": "Computing",
   "description": "network of remote servers"here
  
  Course Sample Data:(Add first 3 courses on every category added from the netplay app)
  id : 2001,
  Category id: 1001,
  name : "AWS"
  duration : 180
  miles :100
  </code></pre>
  
  <p>This is service class how to implement the logic here to return the content of list along with sublist</p>
  
  <pre><code>import java.util.Arrays;
  import java.util.List;
  import java.util.ArrayList;
  
  import org.springframework.stereotype.Service;
  
  @Service
  public class ContentService {
  
   private List&lt;Category&gt; categories=new ArrayList&lt;&gt;(Arrays.asList(new Category(1001, "Computing", "network of remote servers"));
  
  //put your code here.
  public List&lt;Category&gt; getAllContent() {
      return categories;
  
  }
  }
  </code></pre>