List<TopTenMessageDTO> list = topTenDao.getMessages();
CollectionUtils.forAllDo(list, new Closure() {
@Override
public void execute(Object o) {
TopTenMessageDTO dto = (TopTenMessageDTO) o;
int tmp = dto.getAnswers() / itemsPerPage;
tmp = (dto.getAnswers() % itemsPerPage > 0) ? tmp + 1 : tmp;
dto.setPages(tmp);
}
});
Map<String, Object> params = new HashMap<>();
params.put("messages", list);