ProtocolBuilderImpl implements ProtocolBuilder { public ProtocolProducer build() { if (parallel) { ParallelProtocolProducer parallelProtocolProducer = new ParallelProtocolProducer(protocols); protocols = null; return parallelProtocolProducer; } else { SequentialProtocolProducer sequentialProtocolProducer = new SequentialProtocolProducer(protocols); protocols = null; return sequentialProtocolProducer; } } protected  ProtocolBuilderImpl(
      BuilderFactory<BuilderT> factory,
      boolean parallel); DRes<T> append(NativeProtocol<T, ?> nativeProtocol); ProtocolProducer build(); BuildStep<Void, BuilderT, R> seq(Computation<R, BuilderT> function); BuildStep<Void, BuilderT, R> par(ComputationParallel<R, BuilderT> f);  }
@Test(expected = IllegalStateException.class) public void build() throws Exception { ProtocolBuilderImpl<BuilderTestClass> protocolBuilder = new BuilderTestClass(); protocolBuilder.append(null); protocolBuilder.build(); protocolBuilder.append(null); }