### Question:
StreamingBuilder implements Builder<Streaming> { public StreamingBuilder withReducer(final String reducer) { this.reducer.set(reducer); return this; } StreamingBuilder(); StreamingBuilder withMapper(final String mapper); StreamingBuilder withReducer(final String reducer); StreamingBuilder withRecordReader(final String recordReader); StreamingBuilder withRecordReaderMapping(final String recordReaderMapping); StreamingBuilder withEnv(final String env); @Override Streaming build();  }### Answer:
@Test public void testWithReducer() { final String reducerName = "reducer-name.sh"; final StreamingBuilder builder = new StreamingBuilder(); builder.withReducer(reducerName); final Streaming streaming = builder.build(); assertEquals(reducerName, streaming.getReducer()); }
@Test public void testWithReducerCalledTwiceThrows() { final String reducerName1 = "reducer-name1.sh"; final String reducerName2 = "reducer-name2.sh"; final StreamingBuilder builder = new StreamingBuilder(); builder.withReducer(reducerName1); expectedException.expect(IllegalStateException.class); builder.withReducer(reducerName2); }