public void insert(int key, int value) {
        GHIntHashSet set = map.get(value);
        if (set == null) {
            map.put(value, set = new GHIntHashSet(slidingMeanValue));
        }
//        else
//            slidingMeanValue = Math.max(5, (slidingMeanValue + set.size()) / 2);
        if (!set.add(key)) {
            throw new IllegalStateException("use update if you want to update " + key);
        }
        size++;
    }
@Test
    public void testInsert() {
        GHSortedCollection instance = new GHSortedCollection();
        assertTrue(instance.isEmpty());
        instance.insert(0, 10);
        assertEquals(1, instance.getSize());
        assertEquals(10, instance.peekValue());
        assertEquals(0, instance.peekKey());
        instance.update(0, 10, 2);
        assertEquals(2, instance.peekValue());
        assertEquals(1, instance.getSize());
        instance.insert(0, 11);
        assertEquals(2, instance.peekValue());
        assertEquals(2, instance.getSize());
        instance.insert(1, 0);
        assertEquals(0, instance.peekValue());
        assertEquals(3, instance.getSize());
    }