public void testDifference() throws Exception {
// =====================================================================
// Test Expectations
// =====================================================================
StatisticsSnapshot snapshot1 = new StatisticsSnapshotImpl(cacheMock,
Period.inMilliSeconds(1000L),
Time.inMilliSeconds(10L),
100, 10, 70);
StatisticsSnapshot snapshot2 = new StatisticsSnapshotImpl(cacheMock,
Period.inMilliSeconds(2000L),
Time.inMilliSeconds(1010L),
220, 24, 100);
StatisticsDelta delta = snapshot2.difference(snapshot1);
assertEquals(Period.inMilliSeconds(1000L), delta.getPeriod());
assertEquals(120, delta.getHitCount());
assertEquals(14, delta.getMissedAddedCount());
assertEquals(30, delta.getRemovedCount());
}