public CompatibilityInfoMap checkPegasusSchemaCompatibility(String prevPegasusSchemaPath, String currentPegasusSchemaPath,
      CompatibilityOptions.Mode compatMode)
  {
    boolean newSchemaCreated = false;
    boolean preSchemaRemoved = false;

    DataSchema preSchema = null;
    try
    {
      preSchema = parseSchema(new File(prevPegasusSchemaPath));
    }
    catch(FileNotFoundException e)
    {
      newSchemaCreated = true;
    }

    DataSchema currSchema = null;
    try
    {
      currSchema = parseSchema(new File(currentPegasusSchemaPath));
    }
    catch(FileNotFoundException e)
    {
      preSchemaRemoved = true;
    }

    if (newSchemaCreated && !preSchemaRemoved)
    {
      constructCompatibilityMessage(CompatibilityMessage.Impact.NEW_SCHEMA_ADDED,
          "New schema %s is created.", currentPegasusSchemaPath);
    }
    if (!newSchemaCreated && preSchemaRemoved)
    {
      constructCompatibilityMessage(CompatibilityMessage.Impact.BREAK_OLD_CLIENTS,
          "Schema %s is removed.", prevPegasusSchemaPath);
    }

    if (preSchema == null || currSchema == null)
    {
      return _infoMap;
    }

    CompatibilityOptions compatibilityOptions = new CompatibilityOptions().setMode(compatMode).setAllowPromotions(true);
    CompatibilityResult result = CompatibilityChecker.checkCompatibility(preSchema, currSchema, compatibilityOptions);

    if (!result.getMessages().isEmpty())
    {
      result.getMessages().forEach(message -> _infoMap.addModelInfo(message));
    }

    if (!_handlers.isEmpty())
    {
      List<SchemaAnnotationHandler.AnnotationCompatibilityResult> annotationCompatibilityResults =
          AnnotationCompatibilityChecker.checkPegasusSchemaAnnotation(preSchema, currSchema, _handlers);
      for (SchemaAnnotationHandler.AnnotationCompatibilityResult annotationResult: annotationCompatibilityResults)
      {
        if (!annotationResult.getMessages().isEmpty())
        {
          annotationResult.getMessages().forEach(message -> _infoMap.addAnnotation(message));
        }
      }
    }

    return _infoMap;
  }
@Test(dataProvider = "compatibleInputFiles")
  public void testCompatiblePegasusSchemaSnapshot(String prevSchema, String currSchema, CompatibilityLevel compatLevel, CompatibilityOptions.Mode mode)
  {
    PegasusSchemaSnapshotCompatibilityChecker checker = new PegasusSchemaSnapshotCompatibilityChecker();
    CompatibilityInfoMap infoMap = checker.checkPegasusSchemaCompatibility(snapshotDir + FS + prevSchema, snapshotDir + FS + currSchema,
        mode);
    Assert.assertTrue(infoMap.isModelCompatible(compatLevel));
  }