source: class ShuffleTest {
  
      public @Rule MockitoRule mockitoRule;
      @Mock ViewGroup parent;
      @Mock ShuffleViewAnimator viewAnimator;
      @Mock ShuffleSettings shuffleSettings;
      @Spy Context context;
       Shuffle shuffle;
  
      @Test
      public void testUpdateAdapter_firstTime() throws Exception {
  
target:         //Given
          given(shuffleSettings.getNumberOfDisplayedCards()).willReturn(3);
          shuffle.adapterPosition = 0;
  
          CardDraggableView draggableView1 = mockDraggableView();
          CardDraggableView draggableView2 = mockDraggableView();
          CardDraggableView draggableView3 = mockDraggableView();
          shuffle.draggableViews.addAll(Arrays.asList(draggableView1, draggableView2, draggableView3));
  
          Shuffle.Adapter shuffleAdapter = mock(Shuffle.Adapter.class);
          Shuffle.ViewHolder mockHolder = mock(Shuffle.ViewHolder.class);
          {
              given(shuffleAdapter.getItemCount()).willReturn(10);
              given(shuffleAdapter.getItemViewType(anyInt())).willReturn(1);
              mockHolder.itemView = mock(View.class);
              given(shuffleAdapter.onCreateViewHolder(any(ViewGroup.class), anyInt())).willReturn(mockHolder);
          }
          //When
          shuffle.setShuffleAdapter(shuffleAdapter);
          //Then
          verify(shuffleAdapter).onCreateViewHolder(eq(draggableView1), anyInt());
          verify(shuffleAdapter).onCreateViewHolder(eq(draggableView2), anyInt());
          verify(shuffleAdapter).onCreateViewHolder(eq(draggableView3), anyInt());
          verify(draggableView1.getContent()).removeAllViews();
          verify(draggableView1.getContent()).addView(eq(mockHolder.itemView));
          assertThat(mockHolder.position).isEqualTo(2);
          verify(shuffleAdapter).onBindViewHolder(eq(mockHolder), eq(0));
          verify(shuffleAdapter).onBindViewHolder(eq(mockHolder), eq(1));
  
      }
  
  }