/** Returns an ArrayList of Annotations with a TicketID. */
  public static ArrayList<Annotation> getAnnotations(int ticketNum) {
    DBHelper db = DBHelperFactory.createDBHelper();
    ArrayList<Annotation> result = db.createAnnotationArrayListByTicket(ticketNum);

    db.close();
    return result;
  }
  /** Returns the last Annotation by date attached to a specified TicketID. */
  public static Annotation getLastAnnotation(int ticketID) {
    DBHelper db = DBHelperFactory.createDBHelper();
    ArrayList<Annotation> temp = db.createAnnotationArrayListByTicket(ticketID);

    Annotation result = temp.get(temp.size() - 1);

    db.close();
    return result;
  }
  /**
   * Returns a formatted string that indicates the last time a Ticket was worked on (in other words,
   * the date of the last annotation)
   */
  public static String getLastActivity(int ticketNumber) {
    DBHelper db = DBHelperFactory.createDBHelper();
    ArrayList<Annotation> annos = db.createAnnotationArrayListByTicket(ticketNumber);

    java.sql.Timestamp lastActivity = new java.sql.Timestamp(0L);

    for (int i = 0; i < annos.size(); i++) {
      java.sql.Timestamp ts = annos.get(i).getCreatedOn();

      if (ts.after(lastActivity)) {
        lastActivity.setTime(ts.getTime());
      }
    }

    String result = getTime(lastActivity);

    db.close();
    return result;
  }