### Question:
ClusterStatsManager { public List<Pair<Long , Integer >> findLazyWorkerStores(final Collection<Long> storeCandidates) { if (storeCandidates == null || storeCandidates.isEmpty()) { return Collections.emptyList(); } final Set<Map.Entry<Long, Set<Long>>> values = this.leaderTable.entrySet(); if (values.isEmpty()) { return Collections.emptyList(); } final Map.Entry<Long, Set<Long>> lazyWorker = Collections.min(values, (o1, o2) -> { final int o1Val = o1.getValue() == null ? 0 : o1.getValue().size(); final int o2Val = o2.getValue() == null ? 0 : o2.getValue().size(); return Integer.compare(o1Val, o2Val); }); final int minLeaderCount = lazyWorker.getValue().size(); final List<Pair<Long, Integer>> lazyCandidates = Lists.newArrayList(); for (final Long storeId : storeCandidates) { final Set<Long> regionTable = this.leaderTable.get(storeId); int leaderCount = regionTable == null ? 0 : regionTable.size(); if (leaderCount <= minLeaderCount) { lazyCandidates.add(Pair.of(storeId, leaderCount)); } } return lazyCandidates; } private  ClusterStatsManager(long clusterId); static ClusterStatsManager getInstance(final long clusterId); long getClusterId(); int regionSize(); void addOrUpdateLeader(final long storeId, final long regionId); Pair<Set<Long /* storeId */>, Integer /* leaderCount */> findModelWorkerStores(final int above); List<Pair<Long /* storeId */, Integer /* leaderCount */>> findLazyWorkerStores(final Collection<Long> storeCandidates); void addOrUpdateRegionStats(final List<Pair<Region, RegionStats>> regionStatsList); Pair<Region, RegionStats> findModelWorkerRegion(); static void invalidCache();  }### Answer:
@Test public void findLazyWorkerStoresTest() { final ClusterStatsManager manager = ClusterStatsManager.getInstance(1); manager.addOrUpdateLeader(10, 101); manager.addOrUpdateLeader(10, 102); manager.addOrUpdateLeader(10, 103); manager.addOrUpdateLeader(11, 104); manager.addOrUpdateLeader(11, 105); manager.addOrUpdateLeader(12, 106); final Collection<Long> storeCandidates = Lists.newArrayList(); storeCandidates.add(10L); storeCandidates.add(11L); storeCandidates.add(12L); List<Pair<Long, Integer>> result = manager.findLazyWorkerStores(storeCandidates); Assert.assertNotNull(result); Assert.assertEquals(1, result.size()); Assert.assertEquals(Long.valueOf(12), result.get(0).getKey()); Assert.assertEquals(Integer.valueOf(1), result.get(0).getValue()); manager.addOrUpdateLeader(10, 105); result = manager.findLazyWorkerStores(storeCandidates); Assert.assertNotNull(result); Assert.assertEquals(2, result.size()); Assert.assertEquals(Integer.valueOf(1), result.get(0).getValue()); }