code: public static synchronized DiagnosticGroup forType(DiagnosticType type) {
      singletons.computeIfAbsent(type, DiagnosticGroup::new);
      return singletons.get(type);
    }
docs: Create a diagnostic group that matches only the given type.