class PrivacyQueries {

  public List<LogWithMetadata> matchingLogs(
      final String privacyGroupId,
      final long fromBlockNumber,
      final long toBlockNumber,
      final LogsQuery query) {

    return LongStream.rangeClosed(fromBlockNumber, toBlockNumber)
        .mapToObj(blockchainQueries::getBlockHashByNumber)
        .takeWhile(Optional::isPresent)
        .map(Optional::get)
        .map(hash -> matchingLogs(privacyGroupId, hash, query))
        .flatMap(List::stream)
        .collect(Collectors.toList());
  }

  public  PrivacyQueries(
      final BlockchainQueries blockchainQueries,
      final PrivateWorldStateReader privateWorldStateReader);

}