void (PsiElement declaration) { if (myDeclarations.contains(declaration)) { myDeclarations.remove(declaration); } else if (declaration instanceof PsiNamedElement) { myDeclarations.remove(findDeclaration(((PsiNamedElement)declaration).getName(), ((PsiNamedElement)declaration).getClass())); } myDeclarations.add(declaration); }