### Question:
JudgmentImportDownloadWriter implements ItemWriter<RawSourceJudgment> { @Override public void write(List<? extends RawSourceJudgment> judgments) throws Exception { log.debug("persisting {} judgments...", judgments.size()); rawSourceJudgmentRepository.save(judgments); rawSourceJudgmentRepository.flush(); entityManager.clear(); }  @Override void write(List<? extends RawSourceJudgment> judgments); @Autowired void setRawSourceJudgmentRepository(RawSourceJudgmentRepository rawSourceJudgmentRepository); @Autowired void setEntityManager(EntityManager entityManager);  }### Answer:
@Test public void write() throws Exception { List<RawSourceCcJudgment> rJudgments = Lists.newArrayList(new RawSourceCcJudgment()); judgmentImportDownloadWriter.write(rJudgments); verify(rawSourceJudgmentRepository).save(Mockito.eq(rJudgments)); }