public static void popupViewAnimationWithIds(View rootView, @IdRes int... viewIds) {
    View[] views = new View[viewIds.length];
    for (int viewIndex = 0; viewIndex < viewIds.length; viewIndex++) {
      int viewId = viewIds[viewIndex];
      if (viewId != 0) {
        views[viewIndex] = rootView.findViewById(viewId);
      }
    }

    popupViewAnimation(views);
  }
@Test
  public void testPopupViewAnimationWithIds() {
    View v1 = Mockito.mock(View.class);
    View v2 = Mockito.mock(View.class);
    Mockito.doReturn(mApplication).when(v1).getContext();
    Mockito.doReturn(mApplication).when(v2).getContext();

    View rootView = Mockito.mock(View.class);
    Mockito.doReturn(v1).when(rootView).findViewById(1);
    Mockito.doReturn(v2).when(rootView).findViewById(2);

    SetupSupport.popupViewAnimationWithIds(rootView, 1, 0, 2);

    ArgumentCaptor<Animation> animation1Captor = ArgumentCaptor.forClass(Animation.class);
    ArgumentCaptor<Animation> animation2Captor = ArgumentCaptor.forClass(Animation.class);
    Mockito.verify(v1).startAnimation(animation1Captor.capture());
    Mockito.verify(v2).startAnimation(animation2Captor.capture());

    Animation animation1 = animation1Captor.getValue();
    Animation animation2 = animation2Captor.getValue();

    Assert.assertEquals(500, animation1.getStartOffset());
    Assert.assertEquals(900, animation2.getStartOffset());
  }