static <ContentType> List<String> compareConstraints(String tableName,
                                             String constraintType,
                                             Set<? extends Constraint<ContentType>> base,
                                             Set<? extends Constraint<ContentType>> other,
                                             boolean compareConstraintNames) {
    List<String> diffs = new ArrayList<>();
    Map<ContentType, Constraint<ContentType>> baseByContent = Maps.newHashMap();
    Map<ContentType, Constraint<ContentType>> otherByContent = Maps.newHashMap();
    for (Constraint<ContentType> c: base) {
      baseByContent.put(c.content(), c);
    }
    for (Constraint<ContentType> c: other) {
      otherByContent.put(c.content(), c);
    }
    diffs.addAll(compareSets(String.format("Comparing %ss of table %s.", constraintType, tableName),
        baseByContent.keySet(),
        otherByContent.keySet()));

    Set<ContentType> common = Sets.intersection(baseByContent.keySet(), otherByContent.keySet());
    for (ContentType constrContent : common) {
      Constraint b = baseByContent.get(constrContent);
      Constraint o = otherByContent.get(constrContent);
      if (!b.name().equals(o.name())) {
        if (compareConstraintNames) {
          diffs.add(String.format("Constraint name mismatch for table %s: %s vs. %s", tableName, b, o));
        }
        else {
          LOG.info("Ignoring constraint name mismatch for table {}: {} vs. {}", tableName, b, o);
        }
      }
    }

    return diffs;
  }
To verify if DDL have certain characteristics:
<ul>
  <li>There are no unnamed constraints</li>
  <li>Alter tables are only used in exceptional cases</li>
  <li>Table and constraint name lenghts doesn't exceed 30 (a restriction imposed by Oracle)</li>
</ul>
ambari-server/src/test/java/org/apache/ambari/server/orm/db/DDLTests.java