public static Alarm alarm(Task task, Member member, DateTime alarmTime) {
   Alarm alarm = new Alarm();
   alarm.setAlarmTime(alarmTime);
   alarm.setMessage(factory.getStrategy().getStringValue());
   alarm.generateGUIDKey();
   alarm.setNotificationType(NotificationTypeEnum.EMAIL.ordinal());
   alarm.setReminderIntervale(5);
   alarm.setReminderIntervaleType(RepeatOccurance.hour.ordinal());
   alarm.setSnoozeTimeInMin(5);
   alarm.setTask(task);
   alarm.setMember(member);
   return alarm;
 }
  public static Invite invite(Calendar calendar, Map<String, String> emails) {
    Invite invite = new Invite();
    invite.setMessage(factory.getStrategy().getStringValue());
    invite.setSubject(factory.getStrategy().getStringValue());
    invite.setShareId(calendar.getId());
    invite.setShareClassName(Calendar.class.getName());
    invite.setInviter(calendar.getMember().getMember());
    invite.setDirectLink("http://reminded.me");
    invite.setNotificationType(NotificationTypeEnum.EMAIL.ordinal());

    invite.setEmailAddresses(emails);

    return invite;
  }
  public static Invite buildInvite(boolean newInvite, String shareId, String className) {
    Invite invite = new Invite();
    invite.setMessage(factory.getStrategy().getStringValue());
    invite.setSubject(factory.getStrategy().getStringValue());
    invite.setShareId(shareId);
    invite.setShareClassName(className);
    //		invite.setShares(shares);

    invite.setDirectLink("http://reminded.me");
    invite.setNotificationType(NotificationTypeEnum.EMAIL.ordinal());

    int emailAddresses = new Random().nextInt(10) + 1;
    Map<String, String> emails = new HashMap<String, String>();
    for (int i = 0; i < emailAddresses; i++) {
      if (i % 2 == 0)
        emails.put(factory.getStrategy().getStringValue(), factory.getStrategy().getStringValue());
      else emails.put(factory.getStrategy().getStringValue(), null);
    }
    invite.setEmailAddresses(emails);

    newObjectCheck(invite, newInvite);

    return invite;
  }