public static void checkForExportRuleToDelete(HashMap<String,ExportRule> sourceExportRuleMap,HashMap<String,ExportRule> targetExportRuleMap,List<ExportRule> exportRulesToDelete){
  for (  String secFlavour : targetExportRuleMap.keySet()) {
    if (!sourceExportRuleMap.containsKey(secFlavour)) {
      exportRulesToDelete.add(targetExportRuleMap.get(secFlavour));
    }
  }
}

public static void checkForExportRuleToDelete ( HashMap < String , ExportRule > sourceExportRuleMap , HashMap < String , ExportRule > targetExportRuleMap , List < ExportRule > exportRulesToDelete ) { for ( String secFlavour : targetExportRuleMap . keySet ( ) ) { if ( ! sourceExportRuleMap . containsKey ( secFlavour ) ) { exportRulesToDelete . add ( targetExportRuleMap . get ( secFlavour ) ) ; } } }
this method checks for export rules that has to deleted on target file system
