title: How to create dynamic List<String>
body: <p>I'm trying to create a List dynamically</p>
  
  <p>I tried to create the List dynamically but it does not allow to create a dynamic List</p>
  
  <pre><code>int length = masterList.size();
  for (int i = 0; i &lt; length; i++) 
  {
      for (Map.Entry &lt; String, Object &gt; entry: masterList.get(i).entrySet()) 
      {
          if(entry.getKey().startsWith("tag_"))
          {
              ArrayList&lt;String&gt; entry.getKey() = new ArrayList();
              tagDataList = Arrays.asList(entry.getValue().toString().split(","));
              for (String string : tagDataList) 
              {
                  entry.getKey().add(string);
              }
          }
       }
  }
  </code></pre>
  
  <p>Input:</p>
  
  <pre><code>{
   "tag_fuse_type": "tag_1,tag_2"
  }
  </code></pre>
  
  <p>Required Output:</p>
  
  <pre><code>{
   "tag_fuse_type": [
    "tag_1",
    "tag_2"
   ]
  }
  </code></pre>