private static IntIntMap parseReplaceSpec(String spec) { IntIntMap map = new IntIntMap(); for (String pidPair : spec.split(",")) { String[] pidPairParsed = pidPair.split(":"); map.put(Integer.parseInt(pidPairParsed[0]), Integer.parseInt(pidPairParsed[1])); } return map; }