title: Java - Map<String, List<Object>> iterate through list and skip first N entries
body: <p>I'm pretty new to Java so please be lenient. I have a map, Map&lt;K,V&gt;. I need to iterate through the values, skip the first N indices and add what remains to another list for processing.</p>
  <p>For example</p>
  <pre><code>Key:   foo
  Value: [id=001, name=Fred, job=Mailman, age=51],
         [id=002, name=Johan, job=Musician, age=335],
         [id=003, name=Alice, job=Finance, age=49],
         [id=004, name=Marcus, job=Developer, age=41]
  </code></pre>
  <p>I'm sorting by age in descending order and I need to skip over the first N list entries.</p>
  <p>The code below is where I'm currently at. Any help is appreciated. Thank you.</p>
  <pre><code>List&lt;Object&gt; finalList = new ArrayList&lt;Object&gt;();
  List&lt;Object&gt; sortedList = new ArrayList&lt;Object&gt;();
  
  Map&lt;String, List&lt;Object&gt; map = getMapFn();
  
  for(List&lt;Object&gt; anotherList : map.values()) {
     Collections.reverse(anotherList);
     sortedList = anotherList;
  
     for(Object o : sortedList) {
        int skipN = N;
  
        for(int i = 0; i &lt; sortedList.size(); i++) {
           if(i &lt; skipN) {
              continue;
           }
        }
        finalList.add(o);
     }
  }
  
  </code></pre>
  <p>Final Goal:</p>
  <pre><code>If N=2,
  finalList = [id=003, name=Alice, job=Finance, age=49],
  [id=004, name=Marcus, job=Developer, age=41]
  </code></pre>