public static SchemaAnnotationProcessResult process(List<SchemaAnnotationHandler> handlers,
                                                      DataSchema dataSchema, AnnotationProcessOption options)
  {
    return process(handlers, dataSchema, options, true);
  }
@Test
  public void testHandlerValidationFailure() throws Exception
  {
    RecordDataSchema testSchema = (RecordDataSchema) TestUtil.dataSchemaFromPdlString(simpleTestSchema);

    SchemaAnnotationHandler testHandlerWithFailure = new PegasusSchemaAnnotationHandlerImpl(TEST_ANNOTATION_LABEL)
    {
      @Override
      public AnnotationValidationResult validate(Map<String, Object> resolvedProperties, ValidationMetaData metaData)
      {
        AnnotationValidationResult result = new AnnotationValidationResult();
        result.setValid(false);
        return result;
      }
    };

    SchemaAnnotationProcessor.SchemaAnnotationProcessResult result =
        SchemaAnnotationProcessor.process(Arrays.asList(testHandlerWithFailure), testSchema,
                                          new SchemaAnnotationProcessor.AnnotationProcessOption());
    assert (!result.isValidationSuccess());
    assert (result.getErrorMsgs()
                  .equals(
                      String.format("Annotation validation process failed in \"%s\" handler. \n",
                                    TEST_ANNOTATION_LABEL)));

    SchemaAnnotationHandler testHandlerWithException = new PegasusSchemaAnnotationHandlerImpl(TEST_ANNOTATION_LABEL)
    {
      @Override
      public AnnotationValidationResult validate(Map<String, Object> resolvedProperties, ValidationMetaData metaData)
      {
        throw new RuntimeException();
      }
    };
    try
    {
      SchemaAnnotationProcessor.SchemaAnnotationProcessResult result2 =
          SchemaAnnotationProcessor.process(Arrays.asList(testHandlerWithException), testSchema,
                                            new SchemaAnnotationProcessor.AnnotationProcessOption());
    }
    catch (IllegalStateException e)
    {
      assert(e.getMessage()
       .equals(String.format("Annotation validation failed in \"%s\" handler.",
                             TEST_ANNOTATION_LABEL)));
    }
  }