public static OperationAuditor createAndInitAuditor(
      Configuration conf,
      String key,
      OperationAuditorOptions options) throws IOException {
    final Class<? extends OperationAuditor> auditClassname
        = conf.getClass(
        key,
        LoggingAuditor.class,
        OperationAuditor.class);
    try {
      LOG.debug("Auditor class is {}", auditClassname);
      final Constructor<? extends OperationAuditor> constructor
          = auditClassname.getConstructor();
      final OperationAuditor instance = constructor.newInstance();
      instance.init(options);
      return instance;
    } catch (NoSuchMethodException | InstantiationException
        | RuntimeException
        | IllegalAccessException | InvocationTargetException e) {
      throw new IOException("Failed to instantiate class "
          + auditClassname
          + " defined in " + key
          + ": " + e,
          e);
    }
  }
@Test
  public void testCreateNonexistentAuditor() throws Throwable {
    final Configuration conf = new Configuration();
    OperationAuditorOptions options =
        OperationAuditorOptions.builder()
            .withConfiguration(conf)
            .withIoStatisticsStore(ioStatistics);
    conf.set(AUDIT_SERVICE_CLASSNAME, "not.a.known.class");
    intercept(RuntimeException.class, () ->
        AuditIntegration.createAndInitAuditor(conf,
            AUDIT_SERVICE_CLASSNAME,
            options));
  }