void (int[] lineMapping) { if (lineMapping.length > 0) { myLineMapping = new HashMap<>(); for (int i = 0; i < lineMapping.length; i += 2) { int key = lineMapping[i + 1]; Set<Integer> existing = myLineMapping.computeIfAbsent(key, k -> new TreeSet<>()); existing.add(lineMapping[i]); } } }