### Question:
EnrichmentTagLawJournalEntryWriter implements ItemWriter<LawJournalEntry> { @Override public void write(List<? extends LawJournalEntry> lawJournalEntries) throws Exception { lawJournalEntryRepository.save(lawJournalEntries); lawJournalEntryRepository.flush(); entityManager.clear(); }  @Override void write(List<? extends LawJournalEntry> lawJournalEntries); @Autowired void setLawJournalEntryRepository(LawJournalEntryRepository lawJournalEntryRepository); @Autowired void setEntityManager(EntityManager entityManager);  }### Answer:
@Test public void write() throws Exception { LawJournalEntry lawJournalEntry1 = new LawJournalEntry(1999, 201, 505, "Ustawa 1"); LawJournalEntry lawJournalEntry2 = new LawJournalEntry(2000, 205, 510, "Ustawa 2"); enrichmentTagLawJournalEntryWriter.write(Lists.newArrayList(lawJournalEntry1, lawJournalEntry2)); InOrder inOrder = inOrder(lawJournalEntryRepository, entityManager); inOrder.verify(lawJournalEntryRepository).save(Lists.newArrayList(lawJournalEntry1, lawJournalEntry2)); inOrder.verify(lawJournalEntryRepository).flush(); inOrder.verify(entityManager).clear(); }