### Question:
PipesBuilder implements Builder<Pipes> { public PipesBuilder withReduce(final String reduce) { this.reduce.set(reduce); return this; } PipesBuilder(); PipesBuilder withMap(final String map); PipesBuilder withReduce(final String reduce); PipesBuilder withInputformat(final String inputformat); PipesBuilder withPartitioner(final String partitioner); PipesBuilder withWriter(final String writer); PipesBuilder withProgram(final String program); @Override Pipes build();  }### Answer:
@Test public void testWithReduce() { final String reduce = "reduce"; final PipesBuilder builder = new PipesBuilder(); builder.withReduce(reduce); final Pipes pipes = builder.build(); assertEquals(reduce, pipes.getReduce()); }
@Test public void testWithReduceCalledTwiceThrows() { final String reduce1 = "reduce1"; final String reduce2= "reduce2"; final PipesBuilder builder = new PipesBuilder(); builder.withReduce(reduce1); expectedException.expect(IllegalStateException.class); builder.withReduce(reduce2); }