### Question:
PipesBuilder implements Builder<Pipes> { public PipesBuilder withInputformat(final String inputformat) { this.inputformat.set(inputformat); 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 testWithInputformat() { final String inputformat = "inputformat"; final PipesBuilder builder = new PipesBuilder(); builder.withInputformat(inputformat); final Pipes pipes = builder.build(); assertEquals(inputformat, pipes.getInputformat()); }
@Test public void testWithInputformatCalledTwiceThrows() { final String inputformat1 = "inputformat1"; final String inputformat2 = "inputformat2"; final PipesBuilder builder = new PipesBuilder(); builder.withInputformat(inputformat1); expectedException.expect(IllegalStateException.class); builder.withInputformat(inputformat2); }