@Override
    public Collection<Lot> searchLots (Map<String,String>params, boolean activeOnly, int maxResults) {
        long requestId = this.findFreeKey(this.foundLotStatuses);
        this.foundLotStatuses.put(requestId, false);
        MsgFindLot msg = new MsgFindLot(this.address, this.ms.getAddressService().getAccountService(), params, requestId);
        this.ms.sendMessage(msg);
        while (!this.foundLotStatuses.get(requestId)){
            try {
                Thread.sleep(10);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        if (!this.foundLots.get(requestId).isEmpty()){
            HashSet<Lot> rez = foundLots.get(requestId);
            //removing used values
            this.foundLotStatuses.remove(requestId);
            this.foundLots.remove(requestId);
            return rez;
        }
        //removing used values
        this.foundLotStatuses.remove(requestId);
        this.foundLots.remove(requestId);
        return null;
    }