### Question:
StaggeredAnimationGroup extends Group { public final void setOnTransitionPreparedListener(@NonNull OnTransitionPreparedListener listener) { Preconditions.checkNotNull(listener, "listener==null"); onPreparedListener = listener; } StaggeredAnimationGroup(Context context);  StaggeredAnimationGroup(Context context, AttributeSet attrs);  StaggeredAnimationGroup(Context context, AttributeSet attrs, int defStyleAttr); final void show(); final void show(boolean inReversedOrder); final void hide(); final void hide(boolean inReversedOrder); final void setPartialTransitionFactory(@NonNull PartialTransitionFactory factory); final void clearPartialTransitionFactory(); final void setOnTransitionPreparedListener(@NonNull OnTransitionPreparedListener listener); final void clearOnTransitionPreparedListener(); final void setPartialDuration(int partialDuration); final void setPartialDelay(int partialDelay); final void setPartialInterpolator(TimeInterpolator partialInterpolator);  }### Answer:
@Test public void setOnStaggeredTransitionPreparedListener_setsField_whenPassed_nonNull_listener() { StaggeredAnimationGroup spiedGroup = prepareSpiedGroup(); StaggeredAnimationGroup.OnTransitionPreparedListener testListener = new StaggeredAnimationGroup.OnTransitionPreparedListener() { @Override public TransitionSet onStaggeredTransitionPrepared(TransitionSet transition, boolean show, boolean inReversedOrder) { return transition; } }; spiedGroup.setOnTransitionPreparedListener(testListener); assertThat(spiedGroup.onPreparedListener).isEqualTo(testListener); }
@Test(expected = NullPointerException.class) public void setOnStaggeredTransitionPreparedListener_throwsNpe_whenPassed_null_listener() { StaggeredAnimationGroup spiedGroup = prepareSpiedGroup(); StaggeredAnimationGroup.OnTransitionPreparedListener listener = null; spiedGroup.setOnTransitionPreparedListener(listener); }