### Question:
SplitOptionsPane extends HBox implements TaskParametersBuildStep<SplitBySizeParametersBuilder>, RestorableView, ResettableView { @Override public void apply(SplitBySizeParametersBuilder builder, Consumer<String> onError) { this.field.validate(); if (this.field.getValidationState() == ValidationState.VALID) { builder.size( ((SizeUnitRadio) group.getSelectedToggle()).unit().toBytes(Integer.valueOf(this.field.getText()))); } else { onError.accept(DefaultI18nContext.getInstance().i18n("Invalid split size")); } } SplitOptionsPane(); @Override void apply(SplitBySizeParametersBuilder 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 apply() { clickOn("#sizeField").write("30").push(KeyCode.ENTER); clickOn("#unit" + SizeUnit.MEGABYTE.symbol()); victim.apply(builder, onError); verify(onError, never()).accept(anyString()); verify(builder).size(eq(30 * 1024 * 1024L)); }
@Test public void applyError() { clickOn("#sizeField").write("Chuck").push(KeyCode.ENTER); victim.apply(builder, onError); verify(onError).accept(anyString()); verify(builder, never()).size(anyLong()); }