title: Insert data in an array list java
body: <p>I have two lists one is feature and has a placement number based on which i insert data in sorted list e.g if placement number is 5 data will be added in 5th position .i want to add data at 5th postion and to move data which was at 5th position to next index but in my case it just replace data at 5th position not move current data to next position   </p>
  
  <pre><code>      for (int i = 0; i &lt; featuredList.size(); i++) {
  
              int n = featuredList.get(i).getPlacementNumber().intValue();
              if (n &lt; sortedList.size()) {
  
                      sortedList.add(n, featuredList.get(i));
  
  
              } else {
                  sortedList.add(featuredList.get(i));
              }
  
  
          }
  </code></pre>