class ShardInfoDownloader {

    public double getShardWeight(Long shardId) {
        Objects.requireNonNull(shardId, "shardId is NULL");
        double res = 0.0D;
        int allPeersNumber = shardInfoByPeers.size();
        Set<PeerFileHashSum> goodPeers = goodPeersMap.get(shardId);
        int goodPeersNumber = (goodPeers == null ? 0 : goodPeers.size());
        Set<PeerFileHashSum> badPeers = badPeersMap.get(shardId);
        int badPeersNumber = (badPeers == null ? 0 : badPeers.size());
        int noShardPeersNumber = allPeersNumber - (goodPeersNumber + badPeersNumber);
        res = (1.0 * goodPeersNumber - 1.0 * badPeersNumber - 1.0 * noShardPeersNumber) / allPeersNumber;
        return res;
    }

    @Inject public  ShardInfoDownloader(PeersService peers);

}