public void mergePrerequisiteChecks(UpgradePack pack) {
    PrerequisiteChecks newPrereqChecks = pack.prerequisiteChecks;
    if (prerequisiteChecks == null) {
      prerequisiteChecks = newPrereqChecks;
      return;
    }

    if (newPrereqChecks == null) {
      return;
    }

    if (prerequisiteChecks.checks == null) {
      prerequisiteChecks.checks = new ArrayList<>();
    }
    if (newPrereqChecks.checks != null) {
      prerequisiteChecks.checks.addAll(newPrereqChecks.checks);
    }

    if (newPrereqChecks.configuration == null) {
      return;
    }

    if (prerequisiteChecks.configuration == null) {
      prerequisiteChecks.configuration = newPrereqChecks.configuration;
      return;
    }
    if (prerequisiteChecks.configuration.globalProperties == null) {
      prerequisiteChecks.configuration.globalProperties = new ArrayList<>();
    }
    if (prerequisiteChecks.configuration.prerequisiteCheckProperties == null) {
      prerequisiteChecks.configuration.prerequisiteCheckProperties = new ArrayList<>();
    }
    if (newPrereqChecks.configuration.globalProperties != null) {
      prerequisiteChecks.configuration.globalProperties.addAll(newPrereqChecks.configuration.globalProperties);
    }
    if (newPrereqChecks.configuration.prerequisiteCheckProperties != null) {
      prerequisiteChecks.configuration.prerequisiteCheckProperties.addAll(newPrereqChecks.configuration.prerequisiteCheckProperties);
    }
  }
Merges the prerequisite checks section of the upgrade xml with
the prerequisite checks from a service's upgrade xml.
These are added to the end of the current list of checks.

@param pack
             the service's upgrade pack
ambari-server/src/main/java/org/apache/ambari/server/stack/upgrade/UpgradePack.java