@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);
  }
@Test
  @SuppressWarnings("deprecation")
  public void testAccumulate() {
    Configuration conf = new Configuration();
    conf.set("ipc.10." + DecayRpcScheduler.IPC_FCQ_DECAYSCHEDULER_PERIOD_KEY,
        "99999999"); // Never flush
    scheduler = new DecayRpcScheduler(1, "ipc.10", conf);

    assertEquals(0, scheduler.getCallCostSnapshot().size()); // empty first

    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());
  }