### Question:
GHSortedCollection { public void update(int key, int oldValue, int value) { remove(key, oldValue); insert(key, value); } 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 testUpdate() { GHSortedCollection instance = new GHSortedCollection(); assertTrue(instance.isEmpty()); instance.insert(0, 10); instance.insert(1, 11); assertEquals(10, instance.peekValue()); assertEquals(2, instance.getSize()); instance.update(0, 10, 12); assertEquals(11, instance.peekValue()); assertEquals(2, instance.getSize()); }