String (ChainVariable inVar, String map, String key) { if(!(myAccType instanceof PsiPrimitiveType)) return null; String boxedType = PsiTypesUtil.boxIfPossible(myAccType.getCanonicalText()); String val = myUpdateTemplate.equals("{acc}++;") ? "1L" : "(" + myAccType.getCanonicalText() + ")" + inVar; String merger = boxedType + "::sum"; return map + ".merge(" + key + "," + val + "," + merger + ");\n"; }