class FilterServiceImpl implements FilterService, Constants {

    public List<Map<String, Object>> getAccounts(String assetGroup)
            throws ServiceException {
        List<Map<String, Object>> accounts;
       try{ accounts = repository.getAccountsFromES(assetGroup);
       }catch(DataException e){
           throw new ServiceException(e);
       }
        List<Map<String, Object>> accountDetails = new ArrayList<>();
        noDataFoundCheck(emptyAssetCount, accounts);
        accounts.parallelStream().forEach(account -> {
            Map<String, Object> accMap = new HashMap<>();

            accMap.put(NAME, account.get(ACCOUNT_NAME));
            accMap.put(ID, account.get(ACCOUNT_ID));
            synchronized (accountDetails) {
                accountDetails.add(accMap);
            }

        });
        if(accountDetails.isEmpty()){
            throw new ServiceException(NO_DATA_FOUND);
        }
        return accountDetails;
    }

}