void (final PsiJavaCodeReferenceElement expression, final Map<PsiClass, PsiClass> oldToNewMap, Map<PsiJavaCodeReferenceElement, PsiElement> rebindExpressions) { final PsiElement resolved = expression.resolve(); if (resolved instanceof PsiClass psiClass && oldToNewMap.containsKey(psiClass)) { rebindExpressions.put(expression, oldToNewMap.get(psiClass)); } }