private Set<EgDemandDetails> carryForwardCollection(final Property newProperty,final Installment inst,final Set<EgDemandDetails> newEgDemandDetailsSet,final Ptdemand ptDmndOld,final PropertyTypeMaster oldPropTypeMaster,final PropertyTypeMaster newPropTypeMaster){
  LOGGER.debug("Entered into carryForwardCollection");
  LOGGER.debug("carryForwardCollection: newProperty: " + newProperty + ", inst: "+ inst+ ", newEgDemandDetailsSet: "+ newEgDemandDetailsSet+ ", ptDmndOld: "+ ptDmndOld+ ", oldPropTypeMaster: "+ oldPropTypeMaster+ ", newPropTypeMaster: "+ newPropTypeMaster);
  final Map<String,BigDecimal> dmdRsnAmt=new LinkedHashMap<String,BigDecimal>();
  final List<String> demandReasonsWithAdvance=new ArrayList<String>(DEMAND_RSNS_LIST);
  demandReasonsWithAdvance.add(PropertyTaxConstants.DEMANDRSN_CODE_ADVANCE);
  for (  final String rsn : demandReasonsWithAdvance) {
    List<EgDemandDetails> oldEgDmndDtlsList=null;
    List<EgDemandDetails> newEgDmndDtlsList=null;
    oldEgDmndDtlsList=getEgDemandDetailsListForReason(ptDmndOld.getEgDemandDetails(),rsn);
    newEgDmndDtlsList=getEgDemandDetailsListForReason(newEgDemandDetailsSet,rsn);
    Map<Installment,EgDemandDetails> oldDemandDtlsMap=null;
    Map<Installment,EgDemandDetails> newDemandDtlsMap=null;
    EgDemandDetails oldDmndDtls=null;
    EgDemandDetails newDmndDtls=null;
    if (oldEgDmndDtlsList != null) {
      oldDemandDtlsMap=getEgDemandDetailsAsMap(oldEgDmndDtlsList);
      oldDmndDtls=oldDemandDtlsMap.get(inst);
    }
    if (newEgDmndDtlsList != null) {
      newDemandDtlsMap=getEgDemandDetailsAsMap(newEgDmndDtlsList);
      newDmndDtls=newDemandDtlsMap.get(inst);
    }
    calculateExcessCollection(dmdRsnAmt,rsn,oldDmndDtls,newDmndDtls);
  }
  excessCollAmtMap.put(inst,dmdRsnAmt);
  demandDetails.put(inst,newEgDemandDetailsSet);
  LOGGER.debug("carryForwardCollection: newEgDemandDetailsSet: " + newEgDemandDetailsSet);
  LOGGER.debug("Exiting from carryForwardCollection");
  return newEgDemandDetailsSet;
}

private Set < EgDemandDetails > carryForwardCollection ( final Property newProperty , final Installment inst , final Set < EgDemandDetails > newEgDemandDetailsSet , final Ptdemand ptDmndOld , final PropertyTypeMaster oldPropTypeMaster , final PropertyTypeMaster newPropTypeMaster ) { LOGGER . debug ( "Entered into carryForwardCollection" ) ; LOGGER . debug ( "carryForwardCollection: newProperty: " + newProperty + ", inst: " + inst + ", newEgDemandDetailsSet: " + newEgDemandDetailsSet + ", ptDmndOld: " + ptDmndOld + ", oldPropTypeMaster: " + oldPropTypeMaster + ", newPropTypeMaster: " + newPropTypeMaster ) ; final Map < String , BigDecimal > dmdRsnAmt = new LinkedHashMap < String , BigDecimal > ( ) ; final List < String > demandReasonsWithAdvance = new ArrayList < String > ( DEMAND_RSNS_LIST ) ; demandReasonsWithAdvance . add ( PropertyTaxConstants . DEMANDRSN_CODE_ADVANCE ) ; for ( final String rsn : demandReasonsWithAdvance ) { List < EgDemandDetails > oldEgDmndDtlsList = null ; List < EgDemandDetails > newEgDmndDtlsList = null ; oldEgDmndDtlsList = getEgDemandDetailsListForReason ( ptDmndOld . getEgDemandDetails ( ) , rsn ) ; newEgDmndDtlsList = getEgDemandDetailsListForReason ( newEgDemandDetailsSet , rsn ) ; Map < Installment , EgDemandDetails > oldDemandDtlsMap = null ; Map < Installment , EgDemandDetails > newDemandDtlsMap = null ; EgDemandDetails oldDmndDtls = null ; EgDemandDetails newDmndDtls = null ; if ( oldEgDmndDtlsList != null ) { oldDemandDtlsMap = getEgDemandDetailsAsMap ( oldEgDmndDtlsList ) ; oldDmndDtls = oldDemandDtlsMap . get ( inst ) ; } if ( newEgDmndDtlsList != null ) { newDemandDtlsMap = getEgDemandDetailsAsMap ( newEgDmndDtlsList ) ; newDmndDtls = newDemandDtlsMap . get ( inst ) ; } calculateExcessCollection ( dmdRsnAmt , rsn , oldDmndDtls , newDmndDtls ) ; } excessCollAmtMap . put ( inst , dmdRsnAmt ) ; demandDetails . put ( inst , newEgDemandDetailsSet ) ; LOGGER . debug ( "carryForwardCollection: newEgDemandDetailsSet: " + newEgDemandDetailsSet ) ; LOGGER . debug ( "Exiting from carryForwardCollection" ) ; return newEgDemandDetailsSet ; }
carry forwards collection from the old property to the newly created property
