Source:
<code>public EmailWrapper sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String regKey) throws EntityDoesNotExistException { if (!isFeedbackSessionExists(feedbackSessionName, courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_CONFIRM + courseId + "/" + feedbackSessionName); } FeedbackSessionAttributes session = getFeedbackSession(feedbackSessionName, courseId); StudentAttributes student = null; InstructorAttributes instructor = null; if (userId != null) { student = studentsLogic.getStudentForCourseIdAndGoogleId(courseId, userId); instructor = instructorsLogic.getInstructorForGoogleId(courseId, userId); } if (student == null && unregisteredStudentEmail != null) { student = new StudentAttributes(); student.email = unregisteredStudentEmail; student.name = unregisteredStudentEmail; student.key = regKey; } Assumption.assertFalse(student == null && instructor == null); try { String timestamp = TimeHelper.formatTime12H( TimeHelper.convertToUserTimeZone(Calendar.getInstance(TimeZone.getTimeZone("UTC")), <START> session.getTimeZone()).getTime()); <END> EmailWrapper email = instructor == null ? new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForStudent(session, student, timestamp) : new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForInstructor(session, instructor, timestamp); new EmailSender().sendEmail(email); return email; } catch (Exception e) { throw new RuntimeException(ERROR_SENDING_EMAILS, e); } }</code><technical_language>issue is timestamp is passed String. If modify timestamp is passed a Calendar Date, perform this conversion EmailGenerator class, making operation testable</technical_language>

Target:
public EmailWrapper sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String regKey) throws EntityDoesNotExistException { if (!isFeedbackSessionExists(feedbackSessionName, courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_FS_CONFIRM + courseId + "/" + feedbackSessionName); } FeedbackSessionAttributes session = getFeedbackSession(feedbackSessionName, courseId); StudentAttributes student = null; InstructorAttributes instructor = null; if (userId != null) { student = studentsLogic.getStudentForCourseIdAndGoogleId(courseId, userId); instructor = instructorsLogic.getInstructorForGoogleId(courseId, userId); } if (student == null && unregisteredStudentEmail != null) { student = new StudentAttributes(); student.email = unregisteredStudentEmail; student.name = unregisteredStudentEmail; student.key = regKey; } Assumption.assertFalse(student == null && instructor == null); try { Calendar timestamp = Calendar.getInstance(TimeZone.getTimeZone("UTC")); EmailWrapper email = instructor == null ? new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForStudent(session, student, timestamp) : new EmailGenerator().generateFeedbackSubmissionConfirmationEmailForInstructor(session, instructor, timestamp); new EmailSender().sendEmail(email); return email; } catch (Exception e) { throw new RuntimeException(ERROR_SENDING_EMAILS, e); } }