@Test
public void testAdd() throws Exception {

  JSONObject obj = new JSONObject();
  obj.put("ref","100");
  obj.put("type","div");
  dom.parseFromJson(obj);
  JSONObject child = new JSONObject();
  child.put("ref","101");
  child.put("type","test");
  WXDomObject childDom = new WXDomObject();
  childDom.parseFromJson(child);
  dom.add(childDom,0);
  assertEquals(dom.getChildCount(),1);
  assertEquals(dom.getChild(0),childDom);
  dom.removeChildAt(0);
  assertEquals(dom.getChildCount(),0);
  dom.add(childDom,0);
  assertEquals(dom.getChildCount(),1);
  assertEquals(dom.getChild(0),childDom);
  dom.remove(childDom);
}