### Question:
StreamingBuilder implements Builder<Streaming> { public StreamingBuilder withMapper(final String mapper) { this.mapper.set(mapper); 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 testWithMapper() { final String mapperName = "mapper-name.sh"; final StreamingBuilder builder = new StreamingBuilder(); builder.withMapper(mapperName); final Streaming streaming = builder.build(); assertEquals(mapperName, streaming.getMapper()); }
@Test public void testWithMapperCalledTwiceThrows() { final String mapperName1 = "mapper-name-2.sh"; final String mapperName2 = "mapper-name-2.sh"; final StreamingBuilder builder = new StreamingBuilder(); builder.withMapper(mapperName1); expectedException.expect(IllegalStateException.class); builder.withMapper(mapperName2); }