### Question:
CcjDeleteRemovedWriter implements ItemWriter<DeletedJudgment> { @Override public void write(List<? extends DeletedJudgment> judgmentsToDelete) throws Exception { List<Long> judgmentIdsToDelete = judgmentsToDelete.stream() .map(j -> j.getJudgmentId()) .collect(Collectors.toList()); judgmentWithEnrichmentDeleter.delete(judgmentIdsToDelete); deletedJudgmentRepository.save(judgmentsToDelete); }  @Override void write(List<? extends DeletedJudgment> judgmentsToDelete);  }### Answer:
@Test public void write() throws Exception { DeletedJudgment judgmentToRemove1 = createDeletedJudgment(1L, "AA1"); DeletedJudgment judgmentToRemove2 = createDeletedJudgment(2L, "AA2"); ccjDeleteRemovedWriter.write(Lists.newArrayList(judgmentToRemove1, judgmentToRemove2)); verify(judgmentWithEnrichmentDeleter).delete(Lists.newArrayList(1L, 2L)); verify(deletedJudgmentRepository).save(Lists.newArrayList(judgmentToRemove1, judgmentToRemove2)); verifyNoMoreInteractions(judgmentWithEnrichmentDeleter, deletedJudgmentRepository); }