TreeAdapter extends PowerAdapter { public boolean isExpanded(int position) { if (mRootAdapter.hasStableIds()) { return mState.isExpanded(mRootAdapter.getItemId(position)); } Entry entry = mEntries.get(position); return entry != null && entry.getAdapter() != null; } TreeAdapter(@NonNull PowerAdapter rootAdapter, @NonNull ChildAdapterSupplier childAdapterSupplier); @NonNull Parcelable saveInstanceState(); void restoreInstanceState(@Nullable Parcelable parcelable); boolean isAutoExpand(); void setAutoExpand(boolean autoExpand); boolean isExpanded(int position); void setExpanded(int position, boolean expanded); boolean toggleExpanded(int position); void setAllExpanded(boolean expanded); @Override int getItemCount(); @Override boolean hasStableIds(); @Override long getItemId(int position); @Override boolean isEnabled(int position); @NonNull @Override Object getItemViewType(int position); @NonNull @Override View newView(@NonNull ViewGroup parent, @NonNull Object viewType); @Override void bindView(
            @NonNull Container container,
            @NonNull View view,
            @NonNull Holder holder,
            @NonNull List<Object> payloads
    );  }
@Test public void isExpandedReturnsTrueWhenChildIsExpanded() { assertThat(mTreeAdapter.isExpanded(1)).isTrue(); }