code: public void setAdapter(RecyclerView.Adapter adapter) {
          if (mWrappedAdapter != null && mWrappedAdapter.getItemCount() > 0) {
              notifyItemRangeRemoved(getHeaderCount(), mWrappedAdapter.getItemCount());
          }
          setWrappedAdapter(adapter);
          notifyItemRangeInserted(getHeaderCount(), mWrappedAdapter.getItemCount());
      }
docs: Replaces the underlying adapter, notifying RecyclerView of changes
  
  @param adapter The new adapter to wrap