void (final UsageInfo[] usages) { for (PsiClass classToMove : myClassesToMove) { for(UsageInfo usageInfo: usages) { if (usageInfo instanceof NonCodeUsageInfo nonCodeUsage) { PsiElement element = nonCodeUsage.getElement(); if (element != null && PsiTreeUtil.isAncestor(classToMove, element, false)) { List<NonCodeUsageInfo> list = element.getCopyableUserData(ourNonCodeUsageKey); if (list == null) { list = new ArrayList<>(); element.putCopyableUserData(ourNonCodeUsageKey, list); } list.add(nonCodeUsage); } } } } }