class 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);

}