@Test
  public void testUpgradePacksInitializedAfterUnmarshalling() throws Exception {
    StackInfo stack = stackManager.getStack("HDP", "2.2.0");
    Map<String, UpgradePack> upgradePacks = stack.getUpgradePacks();
    for (UpgradePack upgradePack : upgradePacks.values()) {
      assertNotNull(upgradePack);
      assertNotNull(upgradePack.getTasks());
      assertTrue(upgradePack.getTasks().size() > 0);

      // reference equality (make sure it's the same list)
      assertTrue(upgradePack.getTasks() == upgradePack.getTasks());
    }
    ConfigUpgradePack configUpgradePack = stack.getConfigUpgradePack();
    assertNotNull(configUpgradePack);
    assertNotNull(configUpgradePack.services);
  }
Tests that {@link UpgradePack} and {@link ConfigUpgradePack} instances are correctly initialized
post-unmarshalling.

@throws Exception
ambari-server/src/test/java/org/apache/ambari/server/stack/StackManagerTest.java