boolean (UsageInfo @NotNull [] usages, @NotNull UsageViewDescriptor descriptor) { // protect against poorly implemented equality Set<PsiElement> elements = new ReferenceOpenHashSet<>(); for (UsageInfo usage : usages) { assert usage != null: "Found null element in usages array"; if (skipNonCodeUsages() && usage.isNonCodeUsage()) { continue; } PsiElement element = usage.getElement(); if (element != null) { elements.add(element); } } elements.addAll(getElementsToWrite(descriptor)); return ensureFilesWritable(myProject, elements); }