Source:
private RecoveryCoursesTable convertToRecoveryCoursesTable(List<CourseAttributes> courses) { RecoveryCoursesTable recoveryCourses = new RecoveryCoursesTable(); int idx = -1; for (CourseAttributes course : courses) { idx++; List<ElementTag> actionsParam = new ArrayList<>(); String restoreLink = getInstructorCourseRestoreRecoveryCourseLink(course.getId()); ElementTag restoreButton = createButton("Restore", "btn btn-default btn-xs t_course_restore" + idx, "", restoreLink, Const.Tooltips.COURSE_RESTORE, false, ""); String deleteLink = getInstructorCourseDeleteRecoveryCourseLink(course.getId(), false); Boolean hasDeletePermission = instructorsForCourses.get(course.getId()).isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); ElementTag deleteButton = createButton("Delete Permanently", "btn btn-default btn-xs course-delete-link " + "t_course_delete" + idx, "", deleteLink, Const.Tooltips.COURSE_DELETE, !hasDeletePermission, "color: red"); deleteButton.setAttribute("data-course-id", course.getId()); actionsParam.add(restoreButton); actionsParam.add(deleteButton); RecoveryCoursesTableRow row = new RecoveryCoursesTableRow(SanitizationHelper.sanitizeForHtml(course.getId()), SanitizationHelper.sanitizeForHtml(course.getName()), course.getCreatedAtDateString(), course.getCreatedAtDateStamp(), course.getCreatedAtFullDateTimeString(), course.getDeletedAtDateString(), course.getDeletedAtDateStamp(), course.getDeletedAtFullDateTimeString(), this.getInstructorCourseStatsLink(course.getId()), actionsParam); recoveryCourses.getRows().add(row); } return recoveryCourses; }

Target:
private RecoveryCoursesTable convertToRecoveryCoursesTable(List<CourseAttributes> courses) { RecoveryCoursesTable recoveryCourses = new RecoveryCoursesTable(); int idx = -1; for (CourseAttributes course : courses) { idx++; List<ElementTag> actionsParam = new ArrayList<>(); String restoreLink = getInstructorCourseRestoreRecoveryCourseLink(course.getId()); ElementTag restoreButton = createButton("Restore", "btn btn-default btn-xs t_course_restore" + idx, "", restoreLink, Const.Tooltips.COURSE_RESTORE, false); String deleteLink = getInstructorCourseDeleteRecoveryCourseLink(course.getId()); Boolean hasDeletePermission = instructorsForCourses.get(course.getId()).isAllowedForPrivilege( Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_COURSE); ElementTag deleteButton = createButton("Delete Permanently", "btn btn-default btn-xs course-delete-link " + "t_course_delete" + idx, "", deleteLink, Const.Tooltips.COURSE_DELETE, !hasDeletePermission); deleteButton.setAttribute("data-course-id", course.getId()); deleteButton.setAttribute("style", "color: red"); actionsParam.add(restoreButton); actionsParam.add(deleteButton); RecoveryCoursesTableRow row = new RecoveryCoursesTableRow(SanitizationHelper.sanitizeForHtml(course.getId()), SanitizationHelper.sanitizeForHtml(course.getName()), course.getCreatedAtDateString(), course.getCreatedAtDateStamp(), course.getCreatedAtFullDateTimeString(), course.getDeletedAtDateString(), course.getDeletedAtDateStamp(), course.getDeletedAtFullDateTimeString(), this.getInstructorCourseStatsLink(course.getId()), actionsParam); recoveryCourses.getRows().add(row); } return recoveryCourses; }