SpaceSaving { public int error(long e) { return getMin(); } SpaceSaving(int n, int size, int keySize);   SpaceSaving(int n, int size); boolean containsKey(long e); int bound(long e); int getMin(); int error(long e); boolean inc(long key); String toString();  }
@Test public void testError() { long key = 611; int n = 1<<10; int size = 1<<5; SpaceSaving ss = new SpaceSaving(n, size, 10); assertTrue(ss.getMin() == ss.error(5)); assertFalse(ss.inc(key)); assertTrue(ss.getMin() == ss.error(7)); }