### Question:
PipesBuilder implements Builder<Pipes> { public PipesBuilder withPartitioner(final String partitioner) { this.partitioner.set(partitioner); 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 testWithPartitioner() { final String partitioner = "partitioner"; final PipesBuilder builder = new PipesBuilder(); builder.withPartitioner(partitioner); final Pipes pipes = builder.build(); assertEquals(partitioner, pipes.getPartitioner()); }
@Test public void testWithPartitionerCalledTwiceThrows() { final String partitioner1 = "partitioner1"; final String partitioner2 = "partitioner2"; final PipesBuilder builder = new PipesBuilder(); builder.withPartitioner(partitioner1); expectedException.expect(IllegalStateException.class); builder.withPartitioner(partitioner2); }