### Question:
ExtractOptionsPane extends HBox implements TaskParametersBuildStep<ExtractParametersBuilder>, RestorableView, ResettableView { @Override public void apply(ExtractParametersBuilder builder, Consumer<String> onError) { this.field.validate(); if (this.field.getValidationState() == ValidationState.VALID) { try { builder.ranges(ConversionUtils.toPageRangeSet(this.field.getText())); } catch (ConversionException e) { onError.accept(e.getMessage()); } } else { onError.accept(DefaultI18nContext.getInstance().i18n("Invalid page ranges")); } } ExtractOptionsPane(); @Override void apply(ExtractParametersBuilder builder, Consumer<String> onError); @Override void saveStateTo(Map<String, String> data); @Override void restoreStateFrom(Map<String, String> data); @Override void resetView();  }### Answer:
@Test public void validSteps() { clickOn("#extractRanges").type(KeyCode.DIGIT5).push(KeyCode.ENTER); victim.apply(builder, onError); verify(builder).ranges(anySet()); verify(onError, never()).accept(anyString()); }
@Test public void applyError() { clickOn("#extractRanges").write("Chuck").push(KeyCode.ENTER); victim.apply(builder, onError); verify(onError).accept(anyString()); verify(builder, never()).ranges(anySet()); }