class FilterServiceImpl implements FilterService, Constants {

    public List<Map<String, Object>> getRegions(String assetGroup)
            throws ServiceException {
        Map<String, Long> regionsMap;

        List<Map<String, Object>> regions = new ArrayList<>();
       try{ regionsMap = repository.getRegionsFromES(assetGroup);
       }catch(DataException e){
           throw new ServiceException(e);
       }
        if (regionsMap.isEmpty()) {
            throw new ServiceException(NO_DATA_FOUND);
        }
        regionsMap.entrySet().parallelStream().forEach(region -> {
            Map<String, Object> regMap = new HashMap<>();
            if (StringUtils.isNotBlank(region.getKey())) {
                regMap.put(NAME, region.getKey());
                regMap.put(ID, region.getKey());
                synchronized (regions) {
                    regions.add(regMap);
                }
            }
        });
        if(regions.isEmpty()){
            throw new ServiceException(NO_DATA_FOUND);
        }
        return regions;

    }

}