public ArrayList<MailMessage> getMailNotifications(List<TimeAlarm> mailAlarm, String UserId) throws ExecutionException
      {

        HashMap<String, ArrayList<TimeAlarm>> buffer = new HashMap<String, ArrayList<TimeAlarm>>();
        ArrayList<MailMessage> listOfMsg = new ArrayList<MailMessage>();

        //ordenamos las alarmas por cuenta de envio
        for (TimeAlarm Talarm : mailAlarm)
          {
            if (!buffer.containsKey(Talarm.getDesigner()))
              {
                ArrayList<TimeAlarm> AlarmContainer = new ArrayList<TimeAlarm>();
                AlarmContainer.add(Talarm);
                buffer.put(Talarm.getDesigner(), AlarmContainer);
              } 
            else
              {
                ArrayList<TimeAlarm> AlarmContainer = buffer.get(Talarm.getDesigner());
                AlarmContainer.add(Talarm);
                buffer.put(Talarm.getDesigner(), AlarmContainer);
              }
          }

        //crear los mensajes
        //informacion comun
      //  UserData userData = retrieveUserInfo(UserId);
       
        UserData userData = this.userCache.get(UserId);
        


//subjet
        String subject = String.format(SubjectMailTemplate,
                                       userData.getCompleteName()
                                       );

        for (Map.Entry<String, ArrayList<TimeAlarm>> entry : buffer.entrySet())
          {
            String finalMsg;
            MailMessage message = new MailMessage();

            ArrayList<TimeAlarm> mail = entry.getValue();
            String NotificationAc = entry.getKey();

            if (mail.size() > 1)
              {
                System.out.println("MENSAJE COMPUESTO______________________");
                finalMsg = String.format(MailFirstLineMultipleAlarms,
                                         userData.getCompleteName()
                                        );

                for (TimeAlarm Talarm : mail)
                  {
                 //   WorkFlowInfo workData = retrieveWorkflowInfo(Talarm.getIdWorkflow());
                    WorkFlowInfo workData = this.workflowCache.get(Talarm.getIdWorkflow());
                    String msg = String.format(AlarmDescriptionTemplate,
                                                getDateFromLong(Talarm.getDeadLine()),
                                                workData.getWorkflowName(),
                                                workData.getWorkflowDescription()
                                               );
                    finalMsg = finalMsg.concat(msg);
                  }

              } 
            else  //size =1
              {
                System.out.println("MENSAJE UNICO______________________" + mail.size());
                finalMsg = String.format(MailFirstLineMultipleAlarms,
                        userData.getCompleteName()
                );
                TimeAlarm Talarm = mail.get(0);

              //  System.out.println("id" + Talarm.getAlarmId());
                //System.out.println("des" + Talarm.getDesigner());

                WorkFlowInfo workData = retrieveWorkflowInfo(Talarm.getIdWorkflow());
                String msg = String.format(AlarmDescriptionTemplate,
                                            getDateFromLong(Talarm.getDeadLine()),
                                            workData.getWorkflowName(),
                                            workData.getWorkflowDescription()
                                           );
                finalMsg = finalMsg.concat(msg);
              }
            //footer 
            finalMsg = finalMsg.concat(FooterTemplate);

            message.setNotificationAcount(NotificationAc);
            message.setToEmail(userData.getEmail());
            message.setSubject(subject);
            message.setMensaje(finalMsg);

            listOfMsg.add(message);
            System.out.println("MAIL_MENSAJE:___ " + finalMsg);
              System.out.println("MAIL_NOT-->" + NotificationAc);
          }
        return listOfMsg;
      }