### Question:
GHSortedCollection { public void insert(int key, int value) { GHIntHashSet set = map.get(value); if (set == null) { map.put(value, set = new GHIntHashSet(slidingMeanValue)); } if (!set.add(key)) { throw new IllegalStateException("use update if you want to update " + key); } size++; } GHSortedCollection(); void clear(); void update(int key, int oldValue, int value); void insert(int key, int value); int peekValue(); int peekKey(); int pollKey(); int getSize(); boolean isEmpty(); int getSlidingMeanValue(); @Override String toString();  }### Answer:
@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()); }