public static List<AnnotationCompatibilityResult> checkPegasusSchemaAnnotation(DataSchema prevSchema, DataSchema currSchema,
      List<SchemaAnnotationHandler> handlers)
  {
    // Update handler list to only contain handlers with implementation of checkCompatibility.
    handlers = handlers
        .stream()
        .filter( h -> h.implementsCheckCompatibility())
        .collect(Collectors.toList());
    SchemaAnnotationProcessor.SchemaAnnotationProcessResult prevSchemaResult = processSchemaAnnotation(prevSchema, handlers);
    SchemaAnnotationProcessor.SchemaAnnotationProcessResult currSchemaResult = processSchemaAnnotation(currSchema, handlers);
    Map<PathSpec, Pair<CompatibilityCheckContext, Map<String, Object>>> prevResolvedPropertiesMap
        = getNodeToResolvedProperties(prevSchemaResult);
    Map<PathSpec, Pair<CompatibilityCheckContext, Map<String, Object>>> currResolvedPropertiesMap
        = getNodeToResolvedProperties(currSchemaResult);

    return getCompatibilityResult(prevResolvedPropertiesMap, currResolvedPropertiesMap, handlers);
  }
@Test(dataProvider = "annotationCompatibilityCheckTestData")
  public void testCheckCompatibility(String prevSchemaFile, String currSchemaFile, List<SchemaAnnotationHandler> handlers, List<AnnotationCompatibilityResult> expectedResults)
      throws IOException
  {
    DataSchema prevSchema = TestUtil.dataSchemaFromPdlInputStream(getClass().getResourceAsStream(prevSchemaFile));
    DataSchema currSchema = TestUtil.dataSchemaFromPdlInputStream(getClass().getResourceAsStream(currSchemaFile));
    List<AnnotationCompatibilityResult> results = AnnotationCompatibilityChecker
        .checkPegasusSchemaAnnotation(prevSchema, currSchema, handlers);
    Assert.assertEquals(results.size(), expectedResults.size());
    for (int i = 0; i < results.size(); i++)
    {
      Assert.assertEquals(results.get(i).getMessages().size(), expectedResults.get(i).getMessages().size());
      List<CompatibilityMessage> actualCompatibilityMessage = (List<CompatibilityMessage>) results.get(i).getMessages();
      List<CompatibilityMessage> expectCompatibilityMessage = (List<CompatibilityMessage>) expectedResults.get(i).getMessages();
      for (int j = 0; j < actualCompatibilityMessage.size(); j++)
      {
        Assert.assertEquals(actualCompatibilityMessage.get(j).toString(), expectCompatibilityMessage.get(j).toString());
      }
    }
  }