code: private void parseDiagnostics() {
          // If we found any meta, then process it with SnakeYAML
          if (state.getDiagnosticBuffer().length() > 0) {
  
              if (state.getLastParsedElement() == null) {
                  throw new ParserException("Found diagnostic information without a previous TAP element.");
              }
  
              try {
                  @SuppressWarnings("unchecked")
                  Map<String, Object> metaIterable = (Map<String, Object>) new Yaml()
                          .load(state.getDiagnosticBuffer().toString());
                  state.getLastParsedElement().setDiagnostic(metaIterable);
              } catch (Exception ex) {
                  throw new ParserException(String.format("Error parsing YAML [%s]: %s",
                          state.getDiagnosticBuffer().toString(), ex.getMessage()), ex);
              }
              this.state.getDiagnosticBuffer().setLength(0);
          }
      }
docs: <p>
  Checks if there is any diagnostic information on the diagnostic buffer.
  </p>
  <p>
  If so, tries to parse it using snakeyaml.
  </p>