protected void expandParentListItem(ParentWrapper parentWrapper,int parentIndex,boolean expansionTriggeredByListItemClick){
  if (!parentWrapper.isExpanded()) {
    parentWrapper.setExpanded(true);
    List<?> childItemList=parentWrapper.getChildItemList();
    if (childItemList != null) {
      int childListItemCount=childItemList.size();
      for (int i=0; i < childListItemCount; i++) {
        mItemList.add(parentIndex + i + 1,childItemList.get(i));
      }
      notifyItemRangeInserted(parentIndex + 1,childListItemCount);
    }
    if (expansionTriggeredByListItemClick && mExpandCollapseListener != null) {
      int expandedCountBeforePosition=getExpandedItemCount(parentIndex);
      mExpandCollapseListener.onListItemExpanded(parentIndex - expandedCountBeforePosition);
    }
  }
}

protected void expandParentListItem ( ParentWrapper parentWrapper , int parentIndex , boolean expansionTriggeredByListItemClick ) { if ( ! parentWrapper . isExpanded ( ) ) { parentWrapper . setExpanded ( true ) ; List < ? > childItemList = parentWrapper . getChildItemList ( ) ; if ( childItemList != null ) { int childListItemCount = childItemList . size ( ) ; for ( int i = 0 ; i < childListItemCount ; i ++ ) { mItemList . add ( parentIndex + i + 1 , childItemList . get ( i ) ) ; } notifyItemRangeInserted ( parentIndex + 1 , childListItemCount ) ; } if ( expansionTriggeredByListItemClick && mExpandCollapseListener != null ) { int expandedCountBeforePosition = getExpandedItemCount ( parentIndex ) ; mExpandCollapseListener . onListItemExpanded ( parentIndex - expandedCountBeforePosition ) ; } } }
expands a specified parent item . calls through to the expandcollapselistener and adds children of the specified parent to the total list of items .
