static HighlightInfo.Builder checkMustNotBeLocal(@NotNull PsiClass aClass) {
    IElementType token;
    JavaFeature feature;
    if (aClass.isEnum()) {
      token = JavaTokenType.ENUM_KEYWORD;
      feature = JavaFeature.LOCAL_ENUMS;
    }
    else if (aClass.isInterface()) {
      token = JavaTokenType.INTERFACE_KEYWORD;
      feature = aClass.isAnnotationType() ? null : JavaFeature.LOCAL_INTERFACES;
    }
    else {
      return null;
    }
    if (!PsiUtil.isLocalClass(aClass)) return null;
    PsiElement anchor = StreamEx.iterate(aClass.getFirstChild(), Objects::nonNull, PsiElement::getNextSibling)
      .findFirst(e -> e instanceof PsiKeyword && ((PsiKeyword)e).getTokenType().equals(token))
      .orElseThrow(NoSuchElementException::new);
    PsiFile file = aClass.getContainingFile();
    if (feature == null) {
      return HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
        .range(anchor)
        .descriptionAndTooltip(JavaErrorBundle.message("annotation.cannot.be.local"))
        ;
    }
    return HighlightUtil.checkFeature(anchor, feature, PsiUtil.getLanguageLevel(file), file);
  }
static HighlightInfo.Builder checkMustNotBeLocal(@NotNull PsiClass aClass)