### Question:
ShardInfoDownloader { public ShardInfo getShardInfo(Long shardId) { Objects.requireNonNull(shardId, "shardId is NULL"); ShardInfo res = null; if (goodPeersMap.isEmpty()) { return res; } Set<PeerFileHashSum> goodShardPeers = goodPeersMap.get(shardId); if (goodShardPeers == null || goodShardPeers.isEmpty()) { return res; } PeerFileHashSum pfhs = goodShardPeers.iterator().next(); if (pfhs == null) { return res; } String peerId = pfhs.getPeerId(); ShardingInfo srdInfo = shardInfoByPeers.get(peerId); for (ShardInfo si : srdInfo.getShards()) { if (si.shardId.longValue() == shardId.longValue()) { res = si; break; } } return res; } @Inject  ShardInfoDownloader(PeersService peers); void setShardInfoByPeers(Map<String, ShardingInfo> testData); void processAllPeersShardingInfo(); boolean processPeerShardingInfo(String pa, ShardingInfo si); ShardingInfo getShardingInfoFromPeer(String addr); Map<String, ShardingInfo> getShardInfoFromPeers(); ShardInfo getShardInfo(Long shardId); double getShardWeight(Long shardId); Map<Long, Double> getShardRelativeWeights(); static final String SHARD_ID_ENV; }### Answer:
@Test public void testGetShardInfo() { Long shardId = 1L; downloader.setShardInfoByPeers(shardInfoByPeers_ALL_GOOD); downloader.processAllPeersShardingInfo(); ShardInfo expResult = shardInfoByPeers_ALL_GOOD.get("1").getShards().get(2); ShardInfo result = downloader.getShardInfo(shardId); assertEquals(expResult, result); }