Shuffle extends FrameLayout { protected void onViewInflated() { int numberOfCards = shuffleSettings.getNumberOfDisplayedCards(); for (int i = numberOfCards - 1; i >= 0; i--) { CardDraggableView draggableView = generateDraggableView(); draggableView.setDraggable(false); updateDraggableView(draggableView); draggableViews.addFirst(draggableView); addView(draggableView); } notifyDataSetChanged(); } Shuffle(Context context);  Shuffle(Context context, AttributeSet attrs);  Shuffle(Context context, AttributeSet attrs, int defStyleAttr); ShuffleSettings getShuffleSettings(); @Nullable Adapter getShuffleAdapter(); void setShuffleAdapter(@Nullable Adapter shuffleAdapter); void addListener(Listener listener); void removeListener(Listener listener); ShuffleViewAnimator getViewAnimator(); void setViewAnimator(ShuffleViewAnimator viewAnimator); void swipeRight(int duration); void swipeLeft(int duration); int getCurrentAdapterPosition(); CardDraggableView getDraggableView(int position); CardDraggableView getLastDraggableView(); CardDraggableView getFirstDraggableView(); void enable(boolean enable); void restartShuffling(); void revert(int duration);  }
@Test public void testOnViewInflated() throws Exception { given(shuffleSettings.getNumberOfDisplayedCards()).willReturn(3); shuffle.onViewInflated(); assertThat(shuffle.draggableViews).hasSize(3); verify(shuffle, times(3)).updateDraggableView(any(CardDraggableView.class)); verify(shuffle, times(3)).addView(any(View.class)); verify(shuffle, times(1)).updateAdapter(); verify(shuffle, times(1)).setFirstCardDraggable(); }