JobBuilder { public JobBuilder<I, O> errorThreshold(final long errorThreshold) { Utils.checkArgument(errorThreshold >= 0, "error threshold must be >= 0"); parameters.setErrorThreshold(errorThreshold); return this; } JobBuilder(); JobBuilder<I, O> named(final String name); JobBuilder<I, O> reader(final RecordReader<I> recordReader); JobBuilder<I, O> filter(final RecordFilter<?> recordFilter); JobBuilder<I, O> mapper(final RecordMapper<?, ?> recordMapper); JobBuilder<I, O> validator(final RecordValidator<?> recordValidator); JobBuilder<I, O> processor(final RecordProcessor<?, ?> recordProcessor); JobBuilder<I, O> marshaller(final RecordMarshaller<?, ?> recordMarshaller); JobBuilder<I, O> writer(final RecordWriter<O> recordWriter); JobBuilder<I, O> errorThreshold(final long errorThreshold); JobBuilder<I, O> enableJmx(final boolean jmx); JobBuilder<I, O> enableBatchScanning(final boolean batchScanning); JobBuilder<I, O> batchSize(final int batchSize); JobBuilder<I, O> jobListener(final JobListener jobListener); JobBuilder<I, O> batchListener(final BatchListener<O> batchListener); JobBuilder<I, O> readerListener(final RecordReaderListener<I> recordReaderListener); JobBuilder<I, O> pipelineListener(final PipelineListener pipelineListener); JobBuilder<I, O> writerListener(final RecordWriterListener<O> recordWriterListener); Job build();  }
@Test(expected = IllegalArgumentException.class) public void whenErrorThresholdIsLessThanZero_thenShouldThrowAnIllegalArgumentException() { new JobBuilder<Integer, Integer>().errorThreshold(-1); }