### Question:
GroupAdapterViewTypeDelegate extends AdapterViewTypeDelegate<HOLDER, List<ViewItem>> { @Override public void bindViewHolder(HOLDER holder, List<ViewItem> viewItems) { unbindViewHolder(holder); for (ViewItem viewItem : viewItems) { final RecyclerView.ViewHolder childViewHolder = getChildViewHolder(viewItem.viewType, getRootViewGroup(holder)); final AdapterViewTypeDelegate delegate = childAdapterViewTypeDelegates.get(viewItem.viewType); delegate.bindViewHolder(childViewHolder, viewItem.model); setChildViewState(childViewHolder, viewItem); getRootViewGroup(holder).addView(childViewHolder.itemView); } } GroupAdapterViewTypeDelegate(List<AdapterViewTypeDelegate> delegates); @Override void bindViewHolder(HOLDER holder, List<ViewItem> viewItems); @Override void bindViewHolder(HOLDER holder, List<ViewItem> viewItems, List<Object> payloads); @Override void unbindViewHolder(HOLDER holder); @Override DiffUtilComparator<List<ViewItem>> createDiffUtilComparator();  }### Answer:
@Test public void bindViewHolder_shouldCreateNewViews_whenBindingWithNoCachedViews() { List<AdapterViewTypeDelegate> delegates = asList( createValidAdapterViewTypeDelegate(0), createValidAdapterViewTypeDelegate(1)); GroupViewHolder groupHolder = createGroupViewHolder(); TargetGroupAdapterViewTypeDelegate target = createTargetDelegateWithState(delegates, emptyList(), emptyList(), groupHolder); List<RecyclerView.ViewHolder> childViewHolders = asList( createChildViewHolder("0"), createChildViewHolder("1") ); List<ViewItem> viewItems = asList( createViewItem(new ChildModel(0, ""), 0), createViewItem(new ChildModel(1, ""), 1) ); expect(delegates.get(0).createViewHolder(groupHolder.viewGroup)).andReturn(childViewHolders.get(0)); expect(delegates.get(1).createViewHolder(groupHolder.viewGroup)).andReturn(childViewHolders.get(1)); delegates.get(0).bindViewHolder(childViewHolders.get(0), viewItems.get(0).model); delegates.get(1).bindViewHolder(childViewHolders.get(1), viewItems.get(1).model); replayAll(); target.bindViewHolder(groupHolder, viewItems); assertThat(groupHolder.viewGroup.getChildCount(), is(2)); assertThat(groupHolder.viewGroup.getChildAt(0), is(childViewHolders.get(0).itemView)); assertThat(groupHolder.viewGroup.getChildAt(1), is(childViewHolders.get(1).itemView)); verifyAll(); }