ItemGroup extends AbstractItemHierarchy implements ItemInflater.ItemParent,
        ItemHierarchy.Observer { public void clear() { if (mChildren.size() == 0) { return; } final int numRemoved = getCount(); for (ItemHierarchy item : mChildren) { item.unregisterObserver(this); } mDirty = true; mChildren.clear(); notifyItemRangeRemoved(0, numRemoved); } ItemGroup();  ItemGroup(Context context, AttributeSet attrs); @Override void addChild(ItemHierarchy child); boolean removeChild(ItemHierarchy child); void clear(); @Override int getCount(); @Override IItem getItemAt(int position); @Override void onChanged(ItemHierarchy hierarchy); @Override void onItemRangeChanged(ItemHierarchy itemHierarchy, int positionStart, int itemCount); @Override void onItemRangeInserted(ItemHierarchy itemHierarchy, int positionStart, int itemCount); @Override void onItemRangeMoved(ItemHierarchy itemHierarchy, int fromPosition, int toPosition,
            int itemCount); @Override void onItemRangeRemoved(ItemHierarchy itemHierarchy, int positionStart, int itemCount); @Override ItemHierarchy findItemById(int id);  }
@Test public void testClear() { mItemGroup.addChild(CHILD_1); mItemGroup.addChild(CHILD_2); mItemGroup.clear(); assertEquals("Should have 0 child", 0, mItemGroup.getCount()); verify(mObserver).onItemRangeRemoved(eq(mItemGroup), eq(0), eq(2)); }