title: How to add element to hashmap of Object,List<Object>
body: <p>I have a list from dao, I want to put this list in a HashMap>, my list can contain a service which have multiple parameters like the serviceId=3. In my final HashMap, the result looks like : <code>{Service 1=[100,A],Service  2=[101,A],Service  3=[Parameter[102,B],Parameter[103,B],Parameter[104,C]]}</code>. </p>
  
  <pre><code>serviceId   paramId   type
   1            100      A
   2            101      A
   3            102      B
   3            103      B
   3            104      C
  </code></pre>
  
  <p>Service.java</p>
  
  <pre><code>private int id;
  //Getters+Setters
  </code></pre>
  
  <p>Parameter.java</p>
  
  <pre><code>private int id;
  private String type;
  //Getters+Setters
  </code></pre>
  
  <p>Test.java</p>
  
  <pre><code> List result = dao.getServiceParam();
  HashMap&lt;Service,List&lt;Parameter&gt;&gt; mapList = new HashMap&lt;Service, List&lt;Parameter&gt;&gt;();   
  if(!result.isEmpty()) {             
  for (int i=0; i&lt; result.size(); i++) {
      Object[] line = (Object[])result.get(i);        
      if ((BigDecimal) line[0]!=null) {
  
      }
      }
      }      
  </code></pre>