@Test
public void createStatisticsForSameDay() throws Exception {
// Create first answer and delete it
Answer answer = new Answer("careUnit", "Some serializable object");
answer.setStatusRetrieved();
answerService.saveAnswer(answer);
Set<Long> ids = new HashSet<Long>();
ids.add(answer.getId());
// delete answers
answerService.deleteAnswersForCareUnit("careUnit", ids);
entityManager.flush();
// create second answer and delete it
answer = new Answer("careUnit", "Some serializable object");
answer.setStatusRetrieved();
answerService.saveAnswer(answer);
ids = new HashSet<Long>();
ids.add(answer.getId());
answerService.deleteAnswersForCareUnit("careUnit", ids);
entityManager.flush();
// Check so that it only exist one statistics row for this careunit and day