### Question:
InputPdfArgumentsController implements Consumer<List<String>> { @Override public void accept(List<String> pdfs) { if (nonNull(pdfs) && !pdfs.isEmpty()) { InputPdfArgumentsLoadRequest event = new InputPdfArgumentsLoadRequest(); pdfs.stream().filter(s -> !s.startsWith("-")).filter(FileType.PDF::matches).map(Paths::get) .filter(Files::isReadable).forEach(event.pdfs::add); if (!event.pdfs.isEmpty()) { eventStudio().broadcast(event); } } }  @Override void accept(List<String> pdfs);  }### Answer:
@Test public void onNull() { new InputPdfArgumentsController().accept(null); verify(listener, never()).onEvent(any()); }
@Test public void onEmpty() { new InputPdfArgumentsController().accept(new ArrayList<>()); verify(listener, never()).onEvent(any()); }
@Test public void onOtherArgs() { new InputPdfArgumentsController().accept(Arrays.asList("-c", "--clean", "-clean")); verify(listener, never()).onEvent(any()); }
@Test public void onNonExisting() { new InputPdfArgumentsController().accept(Arrays.asList("/chuck/norris.pdf")); verify(listener, never()).onEvent(any()); }
@Test public void onNonPdf() throws IOException { new InputPdfArgumentsController().accept(Arrays.asList(folder.newFile("some.txt").getAbsolutePath())); verify(listener, never()).onEvent(any()); }
@Test public void onPdf() throws IOException { new InputPdfArgumentsController().accept(Arrays.asList(folder.newFile("some.pdf").getAbsolutePath(), folder.newFile("some_other.pdf").getAbsolutePath())); ArgumentCaptor<InputPdfArgumentsLoadRequest> captor = ArgumentCaptor .forClass(InputPdfArgumentsLoadRequest.class); verify(listener).onEvent(captor.capture()); assertEquals(2, captor.getValue().pdfs.size()); }