void (Set<Map.Entry<PsiExpression, String>> mappingsSet, PsiElementFactory factory) { for (Map.Entry<PsiExpression, String> entry : mappingsSet) { PsiExpression oldRef = entry.getKey(); PsiElement newRef = factory.createExpressionFromText(entry.getValue(), null); oldRef.replace(newRef); } }