### Question:
UpgradePack { public boolean isDowngradeAllowed(){ return downgradeAllowed; }  String getName(); void setName(String name); String getTarget(); UpgradeType getType(); List<String> getPrerequisiteChecks(); PrerequisiteCheckConfig getPrerequisiteCheckConfig(); void mergePrerequisiteChecks(UpgradePack pack); void mergeProcessing(UpgradePack pack); List<IntermediateStack> getIntermediateStacks(); String getTargetStack(); boolean isComponentFailureAutoSkipped(); boolean isServiceCheckFailureAutoSkipped(); List<Grouping> getAllGroups(); List<Grouping> getGroups(Direction direction); boolean isDowngradeAllowed(); boolean canBeApplied(String targetVersion); Map<String, Map<String, ProcessingComponent>> getTasks(); Map<String, AddComponentTask> getAddComponentTasks(); boolean isAllTarget(); boolean anyGroupTaskMatch(Predicate<Task> taskPredicate);  }### Answer:
@Test public void testIsDowngradeAllowed() throws Exception { Map<String, UpgradePack> upgrades = ambariMetaInfo.getUpgradePacks("HDP", "2.2.0"); assertTrue(upgrades.size() > 0); String upgradePackWithoutDowngrade = "upgrade_test_no_downgrade"; boolean foundAtLeastOnePackWithoutDowngrade = false; for (String key : upgrades.keySet()) { UpgradePack upgradePack = upgrades.get(key); if (upgradePack.getName().equals(upgradePackWithoutDowngrade)) { foundAtLeastOnePackWithoutDowngrade = true; assertFalse(upgradePack.isDowngradeAllowed()); continue; } assertTrue(upgradePack.isDowngradeAllowed()); } assertTrue(foundAtLeastOnePackWithoutDowngrade); }