class ShardInfoDownloader {

    public boolean processPeerShardingInfo(String pa, ShardingInfo si) {
        Objects.requireNonNull(pa, "peerAddress is NULL");
        Objects.requireNonNull(si, "shardInfo is NULL");
        boolean haveShard = false;
        log.trace("shardInfo = {}", si);
        if (si != null) {
            for (ShardInfo s : si.shards) {
                if (myChainId.equals(UUID.fromString(s.chainId))) {
                    haveShard = true;
                    synchronized (this) {
                        Set<String> ps = shardsPeers.get(s.shardId);
                        if (ps == null) {
                            ps = new HashSet<>();
                            shardsPeers.put(s.shardId, ps);
                        }
                        ps.add(pa);
                        Set<ShardInfo> rs = sortedByIdShards.get(s.shardId);
                        if (rs == null) {
                            rs = new HashSet<>();
                            sortedByIdShards.put(s.shardId, rs);
                        }
                        rs.add(s);
                    }
                }
            }
        }
        return haveShard;
    }

    @Inject public  ShardInfoDownloader(PeersService peers);

}