class FastImportBlocksStep implements Consumer<List<BlockWithReceipts>> {

  @Override
  public void accept(final List<BlockWithReceipts> blocksWithReceipts) {
    for (final BlockWithReceipts blockWithReceipts : blocksWithReceipts) {
      if (!importBlock(blockWithReceipts)) {
        throw new InvalidBlockException(
            "Failed to import block",
            blockWithReceipts.getHeader().getNumber(),
            blockWithReceipts.getHash());
      }
    }
    final long firstBlock = blocksWithReceipts.get(0).getNumber();
    final long lastBlock = blocksWithReceipts.get(blocksWithReceipts.size() - 1).getNumber();
    int peerCount = -1; // ethContext is not available in tests
    if (ethContext != null && ethContext.getEthPeers().peerCount() >= 0) {
      peerCount = ethContext.getEthPeers().peerCount();
    }
    LOG.info(
        "Completed importing chain segment {} to {}, Peers: {}", firstBlock, lastBlock, peerCount);
  }

  public  FastImportBlocksStep(
      final ProtocolSchedule protocolSchedule,
      final ProtocolContext protocolContext,
      final ValidationPolicy headerValidationPolicy,
      final ValidationPolicy ommerValidationPolicy,
      final EthContext ethContext);

}