### Question:
ExtractSelectionPane extends MultipleSelectionPane implements TaskParametersBuildStep<ExtractParametersBuilder> { @Override public void apply(ExtractParametersBuilder builder, Consumer<String> onError) { try { table().getItems().stream().forEach(i -> builder.addSource(i.descriptor().toPdfFileSource())); if (!builder.hasInput()) { onError.accept(DefaultI18nContext.getInstance().i18n("No PDF document has been selected")); } } catch (ConversionException e) { LOG.error(e.getMessage()); onError.accept(e.getMessage()); } } ExtractSelectionPane(String ownerModule); @Override void apply(ExtractParametersBuilder builder, Consumer<String> onError);  }### Answer:
@Test public void empty() { victim.apply(builder, onError); verify(onError).accept(anyString()); verify(builder, never()).addSource(any()); }
@Test public void converstionException() throws Exception { populate(); doThrow(new ConversionException("message")).when(builder).addSource(any()); victim.apply(builder, onError); verify(builder).addSource(any()); verify(onError).accept(eq("message")); }
@Test public void hasInput() throws Exception { populate(); when(builder.hasInput()).thenReturn(Boolean.TRUE); victim.apply(builder, onError); verify(onError, never()).accept(anyString()); }