WXHashMap extends HashMap<K, V> { public void setStackTopInstance(String id) { if (!TextUtils.isEmpty(id)) { instancesStack.remove(id); instancesStack.push(id); } }  @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 testSetStackTopInstance() { mWXHashMap.setStackTopInstance("123456"); int size=mWXHashMap.getInstanceStack().size(); assertEquals(1,size); }