public static Map<String, PsiElement> collectNamedElements(PsiElement... elements) {
    final Collector collector = new Collector();
    for (PsiElement element : elements) {
      element.accept(collector);
    }
    return collector.namedElements;
  }
public static Map<String, PsiElement> collectNamedElements(PsiElement... elements)