### Question:
ProgressMessageService extends PersistenceService<ProgressMessage, ProgressMessageDto, Long> { public ProgressMessageQuery createQuery() { return new ProgressMessageQueryImpl(createEntityManager(), progressMessageMapper); } @Inject  ProgressMessageService(EntityManagerFactory entityManagerFactory); ProgressMessageQuery createQuery();  }### Answer:
@Test void testAdd() { progressMessageService.add(PROGRESS_MESSAGE_1); assertEquals(1, progressMessageService.createQuery() .list() .size()); assertEquals(PROGRESS_MESSAGE_1.getId(), progressMessageService.createQuery() .id(PROGRESS_MESSAGE_1.getId()) .singleResult() .getId()); }
@Test void testAddWithNonEmptyDatabase() { addProgressMessages(List.of(PROGRESS_MESSAGE_1, PROGRESS_MESSAGE_2)); assertProgressMessageExists(PROGRESS_MESSAGE_1.getId()); assertProgressMessageExists(PROGRESS_MESSAGE_2.getId()); assertEquals(2, progressMessageService.createQuery() .list() .size()); }