Assert.assertNotNull(summaryInterceptor);
summaryInterceptor.resetStatistics();
}
private void assertTopKeyAccesses(Cache<?, ?> cache, Object key, long expected, boolean readAccesses) {
CacheUsageInterceptor summaryInterceptor = getTopKey(cache);
boolean isLocal = isOwner(cache, key);
Long actual;
if (readAccesses) {
actual = isLocal ? summaryInterceptor.getLocalTopGets().get(String.valueOf(key)) :
summaryInterceptor.getRemoteTopGets().get(String.valueOf(key));
} else {
actual = isLocal ? summaryInterceptor.getLocalTopPuts().get(String.valueOf(key)) :
summaryInterceptor.getRemoteTopPuts().get(String.valueOf(key));
}
Assert.assertEquals(actual == null ? 0 : actual, expected, "Wrong number of accesses");
}