List<PsiElement> () { List<PsiElement> result = new ArrayList<>(myPrimarySearchedElements.size() + myAdditionalSearchedElements.size()); for (SmartPsiElementPointer pointer : myPrimarySearchedElements) { PsiElement element = pointer.getElement(); if (element != null) { result.add(element); } } for (SmartPsiElementPointer pointer : myAdditionalSearchedElements) { PsiElement element = pointer.getElement(); if (element != null) { result.add(element); } } return result; }