void (final Transferable t) { PsiElement[] psiElements = getElementsInTransferable(t); for (PsiElement psiElement : psiElements) { if (!psiElement.getProject().isDisposed()) { consumer.accept(psiElement); } } }