int[] () { int[] res = new int[linesMapping.size() * 2]; int i = 0; for (Entry<Integer, Integer> entry : linesMapping.entrySet()) { res[i] = entry.getKey(); unmappedLines.remove(entry.getKey()); res[i + 1] = entry.getValue() + offset_total + 1; // make it 1 based i += 2; } return res; }