public CompatibilityInfoMap checkRestSpecVsSnapshot(String prevRestSpecPath, String currSnapshotPath, CompatibilityLevel compatLevel)
  {
    return checkCompatibility(prevRestSpecPath, currSnapshotPath, compatLevel, true);
  }
@Test
  public void testIncompatibleRestSpecVsSnapshot()
  {
    final Collection<CompatibilityInfo> restSpecErrors = new HashSet<>();
    final Collection<CompatibilityInfo> restSpecDiffs = new HashSet<>();
    restSpecErrors.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "identifier", "type"),
                                            CompatibilityInfo.Type.TYPE_ERROR, "schema type changed from int to long"));
    restSpecErrors.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "alternativeKeys"),
                                             CompatibilityInfo.Type.ARRAY_MISSING_ELEMENT, "altTwo"));
    restSpecErrors.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "alternativeKeys", "alt", "type"),
                                             CompatibilityInfo.Type.VALUE_NOT_EQUAL, "long", "string"));
    restSpecErrors.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "alternativeKeys", "alt", "keyCoercer"),
                                             CompatibilityInfo.Type.VALUE_NOT_EQUAL, "com.linkedin.restli.tools.twitter.IntLongCoercer", "com.linkedin.restli.tools.twitter.StringLongCoercer"));
    restSpecDiffs.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "supports"),
                                            CompatibilityInfo.Type.SUPERSET, new HashSet<>(Arrays.asList("create"))));
    restSpecDiffs.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "methods"),
                                            CompatibilityInfo.Type.SUPERSET, new HashSet<>(Arrays.asList("create"))));
    restSpecDiffs.add(new CompatibilityInfo(Arrays.<Object>asList("", "collection", "alternativeKeys"),
                                            CompatibilityInfo.Type.SUPERSET, new HashSet<>(Arrays.asList("newAlt"))));

    final RestLiSnapshotCompatibilityChecker checker = new RestLiSnapshotCompatibilityChecker();
    final CompatibilityInfoMap incompatibleInfoMap = checker.checkRestSpecVsSnapshot(RESOURCES_DIR + FS + "idls" + FS + "twitter-statuses-incompatible.restspec.json",
                                                                                     RESOURCES_DIR + FS + "snapshots" + FS + "twitter-statuses.snapshot.json",
                                                                                     CompatibilityLevel.EQUIVALENT);
    Assert.assertTrue(incompatibleInfoMap.isModelEquivalent());

    final Collection<CompatibilityInfo> restSpecIncompatibles = incompatibleInfoMap.getRestSpecIncompatibles();
    final Collection<CompatibilityInfo> restSpecCompatibles = incompatibleInfoMap.getRestSpecCompatibles();

    for (CompatibilityInfo te : restSpecErrors)
    {
      Assert.assertTrue(restSpecIncompatibles.contains(te), "Reported restspec incompatibles should contain: " + te.toString());
      restSpecIncompatibles.remove(te);
    }
    for (CompatibilityInfo di : restSpecDiffs)
    {
      Assert.assertTrue(restSpecCompatibles.contains(di), "Reported restspec compatibles should contain: " + di.toString());
      restSpecCompatibles.remove(di);
    }

    Assert.assertTrue(restSpecIncompatibles.isEmpty());
    Assert.assertTrue(restSpecCompatibles.isEmpty());
  }