public static void updateStatsBottomUp(Delegator delegator, String contentId, List<String> typeList, int branchChangeAmount, int leafChangeAmount) throws GenericEntityException {
GenericValue thisContent = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentId));
if (thisContent == null)
throw new RuntimeException("No entity found for id=" + contentId);
EntityCondition conditionType = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.IN, typeList);
EntityCondition conditionMain = EntityCondition.makeCondition(UtilMisc.toList(EntityCondition.makeCondition("contentId", EntityOperator.EQUALS, contentId), conditionType), EntityOperator.AND);
List<GenericValue> listAll = delegator.findList("ContentAssoc", conditionMain, null, null, null, true);
List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll);
Iterator<GenericValue> iter = listFiltered.iterator();
while (iter.hasNext()) {
GenericValue contentAssoc = iter.next();