void (int shiftOffset) { if (myLineToOffsetMapping != null) { Map<Integer, Integer> newMap = new HashMap<>(); for (Map.Entry<Integer, Integer> entry : myLineToOffsetMapping.entrySet()) { int newValue = entry.getValue(); if (newValue >= 0) { newValue += shiftOffset; } if (newValue >= 0) { newMap.put(entry.getKey(), newValue); } } myLineToOffsetMapping = newMap; } }