### Question:
StaggeredAnimationGroup extends Group { public final void setPartialTransitionFactory(@NonNull PartialTransitionFactory factory) { Preconditions.checkNotNull(factory, "factory==null"); partialTransitionFactory = factory; } 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(expected = NullPointerException.class) public void setPartialTransitionFactory_throwsNpe_whenPassed_null_listener() { StaggeredAnimationGroup spiedGroup = prepareSpiedGroup(); StaggeredAnimationGroup.PartialTransitionFactory factory = null; spiedGroup.setPartialTransitionFactory(factory); }
@Test public void setPartialTransitionFactory_setsField_whenPassed_nonNull_listener() { StaggeredAnimationGroup spiedGroup = prepareSpiedGroup(); StaggeredAnimationGroup.PartialTransitionFactory testFactory = new StaggeredAnimationGroup.PartialTransitionFactory() { @Override public Transition createPartialTransition(boolean show, int viewId, int indexInTransition) { return new AutoTransition(); } }; spiedGroup.setPartialTransitionFactory(testFactory); assertThat(spiedGroup.partialTransitionFactory).isEqualTo(testFactory); }