New instance of List when casting
<p>Does this line:</p>

<pre><code>List params = (List) hashMap.get(key);
</code></pre>

<p>create a new list, or just appends it to the list?</p>

<p>Here is how I use the code:</p>

<pre><code>ParameterCache cache = ParameterCache.getInstance();
        HashMap hashMap = cache.getAllParameters(ParameterCodeConstants.PARAMETER_DORF_REGION, false);
        ArrayList regionIdList=new ArrayList();
        Set keys = hashMap.keySet();
        Iterator it = keys.iterator();
        while (it.hasNext()) {
            BigDecimal key = (BigDecimal) it.next();
            List params = (List) hashMap.get(key);
            if (params != null &amp;&amp; params.size() &gt; 0) {
                ParameterDTO paramDTO = (ParameterDTO) params.get(0);

                String textValue = paramDTO.getParameterTextValue();
                if(textValue.equals(region_id)){
                    regionIdList.add(paramDTO.getRegion());
                }

            }

        }
</code></pre>
