WXHashMap extends HashMap<K, V> { public V removeFromMapAndStack(Object key) { instancesStack.remove(key); return super.remove(key); }  @Override V put(K key, V value); @Override V remove(Object key); V removeFromMapAndStack(Object key); String getStackTopInstanceId(); void setStackTopInstance(String id); Stack<String> getInstanceStack(); String getTag(); void setTag(String tag);  }
@Test public void testRemoveFromMapAndStack() { mWXHashMap.put("one","1"); mWXHashMap.removeFromMapAndStack("one"); assertEquals(true,mWXHashMap.getInstanceStack().empty()); }