title: Best practice for method with Map return
body: <p>Suppose i have a method which has map as return type and uses generics.</p>
  
  <p>I would like to know what is the best practice of filling that Map object.
  Please see the snippet.</p>
  
  <pre><code>public Map&lt;String,?&gt; getEmployeeInfo(String query) {
  
  Map&lt;String,Object&gt; dataMap = new HashMap&lt;String,Object&gt;();
  
      // do some op.
  
      String empId = "abc123";
  
      List&lt;Long&gt; projectIds = new ArrayList&lt;Long&gt;();
  
      List&lt;String&gt; performanceGoals = new ArrayList&lt;String&gt;();
  
  
      dataMap.put("empId",empId);
      dataMap.put("projectIds",projectIds);
      dataMap.put("performanceGoals",performanceGoals);
  
      return dataMap;
  }
  </code></pre>