### Question:
DecayRpcScheduler implements RpcScheduler,
    DecayRpcSchedulerMXBean, MetricsSource { @VisibleForTesting Map<Object, Long> getCallCostSnapshot() { HashMap<Object, Long> snapshot = new HashMap<Object, Long>(); for (Map.Entry<Object, List<AtomicLong>> entry : callCosts.entrySet()) { snapshot.put(entry.getKey(), entry.getValue().get(0).get()); } return Collections.unmodifiableMap(snapshot); } DecayRpcScheduler(int numLevels, String ns, Configuration conf); @Override int getPriorityLevel(Schedulable obj); @Override boolean shouldBackOff(Schedulable obj); @Override void addResponseTime(String callName, Schedulable schedulable,
      ProcessingDetails details); int getUniqueIdentityCount(); long getTotalCallVolume(); long getTotalRawCallVolume(); long getTotalServiceUserCallVolume(); long getTotalServiceUserRawCallVolume(); long[] getResponseTimeCountInLastWindow(); @Override double[] getAverageResponseTime(); @Override void getMetrics(MetricsCollector collector, boolean all); String getSchedulingDecisionSummary(); String getCallVolumeSummary(); @VisibleForTesting DecayRpcSchedulerDetailedMetrics getDecayRpcSchedulerDetailedMetrics(); @Override void stop(); static final String IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_KEY; static final long IPC_SCHEDULER_DECAYSCHEDULER_PERIOD_DEFAULT; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY; static final String IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_KEY; static final double IPC_SCHEDULER_DECAYSCHEDULER_FACTOR_DEFAULT; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_FACTOR_KEY; static final String IPC_DECAYSCHEDULER_THRESHOLDS_KEY; @Deprecated
  static final String IPC_FCQ_DECAYSCHEDULER_THRESHOLDS_KEY; static final String IPC_DECAYSCHEDULER_SERVICE_USERS_KEY; static final String DECAYSCHEDULER_UNKNOWN_IDENTITY; static final String IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_ENABLE_KEY; static final Boolean IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_ENABLE_DEFAULT; static final String IPC_DECAYSCHEDULER_BACKOFF_RESPONSETIME_THRESHOLDS_KEY; static final String DECAYSCHEDULER_METRICS_TOP_USER_COUNT; static final int DECAYSCHEDULER_METRICS_TOP_USER_COUNT_DEFAULT; static final Logger LOG; }### Answer:
@Test @SuppressWarnings("deprecation") public void testAccumulate() { Configuration conf = new Configuration(); conf.set("ipc.10." + DecayRpcScheduler.IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY, "99999999"); scheduler = new DecayRpcScheduler(1, "ipc.10", conf); assertEquals(0, scheduler.getCallCostSnapshot().size()); getPriorityIncrementCallCount("A"); assertEquals(1, scheduler.getCallCostSnapshot().get("A").longValue()); assertEquals(1, scheduler.getCallCostSnapshot().get("A").longValue()); getPriorityIncrementCallCount("A"); getPriorityIncrementCallCount("B"); getPriorityIncrementCallCount("A"); assertEquals(3, scheduler.getCallCostSnapshot().get("A").longValue()); assertEquals(1, scheduler.getCallCostSnapshot().get("B").longValue()); }