code: public void collapse(boolean notifyItemChanged) {
          int[] expandedItems = getExpandedItems();
          for (int i = expandedItems.length - 1; i >= 0; i--) {
              collapse(expandedItems[i], notifyItemChanged);
          }
      }
docs: collapses all expanded items
  
  @param notifyItemChanged true if we need to call notifyItemChanged. DEFAULT: false