private Answer<PeerTaskExecutorResult<List<BlockHeader>>> peerTaskExecutorResultAnswer(
      final Blockchain remoteBlockchain) {
    return new Answer<PeerTaskExecutorResult<List<BlockHeader>>>() {
      @Override
      public PeerTaskExecutorResult<List<BlockHeader>> answer(
          final InvocationOnMock invocationOnMock) throws Throwable {
        GetHeadersFromPeerTask getHeadersTask =
            invocationOnMock.getArgument(0, GetHeadersFromPeerTask.class);
        long blockNumber = getHeadersTask.getBlockNumber();
        int maxHeaders = getHeadersTask.getMaxHeaders();
        int skip = getHeadersTask.getSkip();

        List<BlockHeader> headers = new ArrayList<>();
        for (long i = blockNumber; i > blockNumber - (maxHeaders - 1) * (skip + 1); i -= skip + 1) {
          headers.add(remoteBlockchain.getBlockHeader(i).get());
        }

        return new PeerTaskExecutorResult<List<BlockHeader>>(
            Optional.of(headers), PeerTaskExecutorResponseCode.SUCCESS, Optional.empty());
      }
    };
  }
@param localBlockCount The number of local blocks to create. Highest block will be: {@code
    localBlockHeight} - 1.
@param remoteBlockCount The number of remote blocks to create. Highest block will be: {@code
    remoteBlockCount} - 1.
@param blocksInCommon The number of blocks shared between local and remote. If a common
    ancestor exists, its block number will be: {@code blocksInCommon} - 1
@return the test blockchain
ethereum/eth/src/test/java/org/hyperledger/besu/ethereum/eth/sync/tasks/DetermineCommonAncestorTaskTest.java