code: @DefinedBy(Api.COMPILER)
      public Diagnostic.Kind getKind() {
          switch (diagnosticInfo.type) {
          case NOTE:
              return Diagnostic.Kind.NOTE;
          case WARNING:
              return flags.contains(DiagnosticFlag.MANDATORY)
                      ? Diagnostic.Kind.MANDATORY_WARNING
                      : Diagnostic.Kind.WARNING;
          case ERROR:
              return Diagnostic.Kind.ERROR;
          default:
              return Diagnostic.Kind.OTHER;
          }
      }
docs: Methods for javax.tools.Diagnostic