List<Attends> attendsResult = new ArrayList<Attends>(bean.getAttendsResult());
Collections.sort(attendsResult, Attends.COMPARATOR_BY_STUDENT_NUMBER);
for (Attends attends : attendsResult) {
HtmlTableRow row = htmlTable.createRow();
if (bean.getViewPhoto()) {
HtmlImage htmlImage = new HtmlImage();
htmlImage.setSource(RenderUtils.getContextRelativePath("") + "/user/photo/"
+ attends.getRegistration().getStudent().getPerson().getUsername());
row.createCell().setBody(htmlImage);
}
row.createCell(attends.getRegistration().getStudent().getPerson().getUsername());
row.createCell(attends.getRegistration().getNumber().toString());