### Question:
ForEachModelAction extends BaseStatefulAction { @Override public void activate(ActionContext context) { List<String>stillFiring=getVariable(VAR_STILL_FIRING, context, TypeMarker.listOf(String.class)).or(ImmutableList.<String>of()); forEachMatchingModel(context, Predicates.addressExistsIn(stillFiring),new ActionContextModelConsumer() { @Override public void accept(ActionContext context, Model model) { context.logger().debug("activating delegate for model {}",model); delegate.activate(context); } }); this.stillFiring= TypeUtil.INSTANCE.coerceList(Address.class, stillFiring); } ForEachModelAction(
         StatefulAction delegate, 
         Predicate<Model> selector, 
         Predicate<Model> condition, 
         String targetVariable
   ); @Override String getName(); @Override String getDescription(); @Override boolean isSatisfiable(ActionContext context); @Override ActionState execute(ActionContext context); @Override ActionState keepFiring(ActionContext context, RuleEvent event, boolean conditionMatches); @Override void activate(ActionContext context); @Override String toString(); static final String VAR_STILL_FIRING; }### Answer:
@Test public void testActivate() { RuleContext namespacedContext = new NamespaceContext(model1.getId(), context); context.setVariable(ForEachModelAction.VAR_STILL_FIRING, ImmutableList.<String>of(model1.getAddress().getRepresentation())); ForEachModelAction action = new ForEachModelAction(mockAction, Predicates.<Model>alwaysTrue(), Predicates.<Model>alwaysTrue(), "address"); mockAction.activate(namespacedContext); EasyMock.expectLastCall(); EasyMock.replay(mockAction); action.activate(context); EasyMock.verify(mockAction); }