private void fixReferencesToStatic(PsiElement classMember) throws IncorrectOperationException {
    final StaticReferencesCollector collector = new StaticReferencesCollector();
    classMember.accept(collector);
    ArrayList<PsiJavaCodeReferenceElement> refs = collector.getReferences();
    ArrayList<PsiElement> members = collector.getReferees();
    ArrayList<PsiClass> classes = collector.getRefereeClasses();
    PsiElementFactory factory = JavaPsiFacade.getElementFactory(classMember.getProject());

    for (int i = 0; i < refs.size(); i++) {
      PsiJavaCodeReferenceElement ref = refs.get(i);
      PsiElement namedElement = members.get(i);
      PsiClass aClass = classes.get(i);

      if (namedElement instanceof PsiNamedElement) {
        PsiElement oldQualifier = ref.getQualifier();
        if (oldQualifier != null) {
          oldQualifier.delete();
        }
        String template = aClass.getQualifiedName() + "." + ref.getText();
        PsiJavaCodeReferenceElement newRef = ref instanceof PsiReferenceExpression ?
                                             (PsiReferenceExpression)factory.createExpressionFromText(template, null) :
                                             factory.createReferenceFromText(template, null);
        Objects.requireNonNull(newRef.getQualifier()).putCopyableUserData(PRESERVE_QUALIFIER, oldQualifier != null);
        ref.replace(newRef);
      }
    }
  }
private void fixReferencesToStatic(PsiElement classMember)