UsageData (@NotNull PsiMember constructorOrClass) { List<PsiNewExpression> newUsages = new ArrayList<>(); List<PsiElement> otherUsages = new ArrayList<>(); for (PsiReference reference : ReferencesSearch.search(constructorOrClass, constructorOrClass.getUseScope(), false)) { PsiElement element = reference.getElement(); if (element.getParent() instanceof PsiNewExpression newExpression) { newUsages.add(newExpression); } else if ("super".equals(element.getText()) || "this".equals(element.getText())) { otherUsages.add(element); } else if (element instanceof PsiMethod && ((PsiMethod)element).isConstructor()) { otherUsages.add(element); } else if (element instanceof PsiClass) { otherUsages.add(element); } } return new UsageData(newUsages, otherUsages); }