WXHashMap extends HashMap<K, V> { public String getStackTopInstanceId() { return instancesStack.isEmpty() ? "" : instancesStack.pop(); }  @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 testGetStackTopInstanceId() { mWXHashMap.setStackTopInstance("123456"); mWXHashMap.setStackTopInstance("654321"); String id=mWXHashMap.getStackTopInstanceId(); assertEquals("654321",id); }