title: How to generate hashmap or hashtable from list of class object using stream map in java8?
body: <pre><code>class Student {
      int studentId;
      String studentName;
      String studentDept;
      public Student() {}
  }
  </code></pre>
  
  <p>I have these student object list that is,</p>
  
  <pre><code>List&lt;Student&gt; studentList;
  </code></pre>
  
  <p>I want to generate hash map from these student list object.</p>
  
  <pre><code>HashMap&lt;Integer,String&gt; studentHash;
  </code></pre>
  
  <p>hashmap contain sudentid and name list key value pair.</p>