### Question:
TransitionAnimatorCreator { public Collection<Animator> create(List<Transition> transitions, Map<String, Element> from, Map<String, Element> to) { if (transitions.isEmpty()) return Collections.EMPTY_LIST; List<Animator> animators = new ArrayList<>(); for (Transition transition : transitions) { animators.addAll(create(transition, from.get(transition.fromId.get()), to.get(transition.toId.get()))); } return animators; }  Collection<Animator> create(List<Transition> transitions, Map<String, Element> from, Map<String, Element> to);  }### Answer:
@Test public void createAnimatorsForEachTransition() { TransitionAnimatorCreator spy = spy(uut); spy.create( Arrays.asList(t1, t2), keyBy(Arrays.asList(e1, e3), Element::getElementId), keyBy(Arrays.asList(e2, e4), Element::getElementId) ); verify(spy).create(t1, e1, e2); verify(spy).create(t2, e3, e4); }
@Test public void create_animatorsAreCreated() { List<Transition> transitions = Arrays.asList(t1, t2); uut.create( transitions, keyBy(Arrays.asList(e1, e3), Element::getElementId), keyBy(Arrays.asList(e2, e4), Element::getElementId) ); verify(animator1, times(2)).shouldAnimateProperty(); verify(animator2, times(2)).shouldAnimateProperty(); verify(animator3, times(2)).shouldAnimateProperty(); for (Transition transition : transitions) { verify(animator1).create(transition); verify(animator2).create(transition); } verifyNoMoreInteractions(animator3); }