### Question:
SingleFileDropController { @EventListener public void request(SingleFileDroppedEvent event) { event.files.stream().filter(f -> FileType.PDF.matches(f.getName())).filter(File::isFile) .map(PdfDocumentDescriptor::newDescriptorNoPassword).findFirst().ifPresent(file -> { PdfLoadRequestEvent loadEvent = new PdfLoadRequestEvent(event.getOwnerModule()); loadEvent.add(file); eventStudio().broadcast(loadEvent, event.getOwnerModule()); }); } @Inject  SingleFileDropController(); @EventListener void request(SingleFileDroppedEvent event);  }### Answer:
@Test public void noPdf() throws IOException { victim.request(new SingleFileDroppedEvent(MODULE, Arrays.asList(folder.newFile()))); assertFalse(listener.isHit()); }
@Test public void directory() throws IOException { victim.request(new SingleFileDroppedEvent(MODULE, Arrays.asList(folder.newFolder()))); assertFalse(listener.isHit()); }
@Test public void onePdf() throws IOException { victim.request(new SingleFileDroppedEvent(MODULE, Arrays.asList(folder.newFile(), folder.newFile("test.pdf")))); assertTrue(listener.isHit()); }