docs: final void checkModifiersIfNested(TypeElement type) {
      ElementKind enclosingKind = type.getEnclosingElement().getKind();
      if (enclosingKind.isClass() || enclosingKind.isInterface()) {
        if (type.getModifiers().contains(Modifier.PRIVATE)) {
          errorReporter.abortWithError(
              "@" + simpleAnnotationName + " class must not be private", type);
        } else if (Visibility.effectiveVisibilityOfElement(type).equals(Visibility.PRIVATE)) {
          // The previous case, where the class itself is private, is much commoner so it deserves
          // its own error message, even though it would be caught by the test here too.
          errorReporter.abortWithError(
              "@" + simpleAnnotationName + " class must not be nested in a private class", type);
        }
        if (!type.getModifiers().contains(Modifier.STATIC)) {
          errorReporter.abortWithError(
              "Nested @" + simpleAnnotationName + " class must be static", type);
        }
      }
      // In principle type.getEnclosingElement() could be an ExecutableElement (for a class
      // declared inside a method), but since RoundEnvironment.getElementsAnnotatedWith doesn't
      // return such classes we won't see them here.
    }