class HBaseNotificationStore implements NotificationStore {

    @Override
    public <T> List<T> findEntities(Criteria<T> criteria) {
        List<T> entities = new ArrayList<>();
        LOG.debug("Finding entities from HBaseNotificationStore, Criteria {}", criteria);
        try {
            HBaseScanConfig<T> scanConfig = hBaseScanConfigBuilder.getScanConfig(criteria);
            LOG.debug("HBaseScanConfig for scan {}", scanConfig);
            if (scanConfig != null) {
                // From start to end row
                byte[] startRow = scanConfig.getStartRow();
                byte[] stopRow = scanConfig.getStopRow();
                Scan scan;
                if(criteria.isDescending()) {
                    scan = new Scan(stopRow, startRow);
                    scan.setReversed(true);
                } else {
                    scan = new Scan(startRow, stopRow);
                }
                scan.setFilter(scanConfig.filterList());
                ResultScanner scanner = tables.get(scanConfig.getMapper().getTableName()).get().getScanner(scan);
                for (Result result : scanner) {
                    entities.add(scanConfig.getMapper().entity(result));
                }
            }
        } catch (IOException ex) {
            throw new NotificationStoreException("Error during scan", ex);
        }

        return entities;
    }

}