private static boolean isTypingAnnotationForNewMember(PsiElement position) {
    if (psiElement(PsiIdentifier.class)
      .withParents(PsiJavaCodeReferenceElement.class, PsiAnnotation.class, PsiModifierList.class).accepts(position)) {
      PsiElement parent = Objects.requireNonNull(PsiTreeUtil.getParentOfType(position, PsiModifierList.class)).getParent();
      if (parent instanceof PsiClass) {
        return true;
      }

      if (parent instanceof PsiMethod || parent instanceof PsiField) {
        PsiAnnotation anno = Objects.requireNonNull(PsiTreeUtil.getParentOfType(position, PsiAnnotation.class));
        return anno.getTextRange().getStartOffset() == parent.getTextRange().getStartOffset() && isFollowedByEol(anno);
      }
    }
    return false;
  }
private static boolean isTypingAnnotationForNewMember(PsiElement position)