### Question:
ExtractParametersBuilder extends MultiplePdfSourceMultipleOutputParametersBuilder<ExtractPagesParameters> { @Override public ExtractPagesParameters build() { ExtractPagesParameters params = new ExtractPagesParameters(); params.setCompress(isCompress()); params.setExistingOutputPolicy(existingOutput()); params.setVersion(getVersion()); params.setOutput(getOutput()); params.setOptimizationPolicy(getOptimizationPolicy()); params.discardOutline(isDiscardBookmarks()); params.addAllPageRanges(ranges); params.setOutputPrefix(getPrefix()); params.setInvertSelection(invertSelection); getInputs().forEach(params::addSource); return params; }  void optimizationPolicy(OptimizationPolicy optimizationPolicy); OptimizationPolicy getOptimizationPolicy(); void ranges(Set<PageRange> ranges); void invertSelection(boolean invertSelection); @Override ExtractPagesParameters build();  }### Answer:
@Test public void build() throws IOException { ExtractParametersBuilder victim = new ExtractParametersBuilder(); victim.compress(true); FileOrDirectoryTaskOutput output = mock(FileOrDirectoryTaskOutput.class); victim.output(output); victim.existingOutput(ExistingOutputPolicy.OVERWRITE); victim.discardBookmarks(true); victim.prefix("prefix"); victim.invertSelection(true); PdfFileSource source = PdfFileSource.newInstanceNoPassword(folder.newFile("my.pdf")); victim.addSource(source); victim.addSource(PdfFileSource.newInstanceNoPassword(folder.newFile("mytest.pdf"))); victim.version(PdfVersion.VERSION_1_7); Set<PageRange> ranges = ConversionUtils.toPageRangeSet("2,5-20,33"); victim.ranges(ranges); ExtractPagesParameters params = victim.build(); assertTrue(params.isCompress()); assertTrue(params.discardOutline()); assertEquals(ExistingOutputPolicy.OVERWRITE, params.getExistingOutputPolicy()); assertEquals(PdfVersion.VERSION_1_7, params.getVersion()); assertEquals(OptimizationPolicy.AUTO, params.getOptimizationPolicy()); assertEquals(ranges, params.getPageSelection()); assertEquals(output, params.getOutput()); assertTrue(params.isInvertSelection()); assertEquals("prefix", params.getOutputPrefix()); assertEquals(2, params.getSourceList().size()); assertEquals(source, params.getSourceList().get(0)); }