private static DeclarationKind getDeclarationKind(PsiElement element) {
    if (element instanceof PsiMethod) return DeclarationKind.METHOD;
    if (element instanceof PsiEnumConstant) return DeclarationKind.ENUM_CONST;
    if (element instanceof PsiField) return DeclarationKind.FIELD;
    if (element instanceof GroovyProperty) return DeclarationKind.FIELD;
    if (element instanceof PsiVariable) return DeclarationKind.VARIABLE;
    if (element instanceof PsiClass) return DeclarationKind.CLASS;
    if (element instanceof PsiPackage) return DeclarationKind.PACKAGE;
    return null;
  }
private static DeclarationKind getDeclarationKind(PsiElement element)