title: How to create a HashMap that would have String as key and the value would be another HashMap from one list of custom object?
body: <p>I have a list of custom object,</p>
  <pre><code>public class Assignmentsdata {
  
      String assignmentId;
      String teacherId;
      String groupName;
      String sectionId;
      String levelId;
      String startTime;
  }
  
  ArrayList&lt;Assignmentsdata&gt; list = new ArrayList&lt;&gt;();
  </code></pre>
  <blockquote>
  <p>lets say there are 20 elements in that list.</p>
  </blockquote>
  <p>Now I want to get the output which is a hashmap of startTime as a key and the Value would be a new HashMap of GroupID and a list of Assignments of those that had the same groupName.</p>
  <p><strong>OutPut Example</strong></p>
  <p>HashMap&lt;startTime,HasMap&lt;groupName,List&gt; hashMap = new HashMap();</p>
  <p>a little more insight about the problem:  First I want to categorise based on startTime(Month) then i want to categorise based on groupName, Thanks in advance.</p>
  <p>I have successfully categorised based on group name and created a map through below code:</p>
  <pre><code> for( int i = 0; i&lt;assignmentsdataArrayList.size();i++ ){
                  if (hashMap.size()&gt;0){
                      hashMap.get(assignmentsdataArrayList.get(i).getGroupName()).add(assignmentsdataArrayList.get(i));
                  }else {
                      hashMap.put(assignmentsdataArrayList.get(i).getGroupName(),new ArrayList&lt;Assignmentsdata&gt;());
                      hashMap.get(assignmentsdataArrayList.get(i).getGroupName()).add(assignmentsdataArrayList.get(i));
                  }
              }
  </code></pre>
  <p><strong>After that I am lost on how to categorise this hashmap based on the startDate and create a hashmap that would look like the above hashmap in the output heading.</strong></p>