Source:
<code>private void populateAndVerifyTimeWindowCase(final KieBase kieBase) { final KieSessionConfiguration sessionConfiguration = KieSessionUtil.getKieSessionConfigurationWithClock(ClockTypeOption.get("pseudo"), null); this.initKieSession(kieBase, sessionConfiguration); final SessionPseudoClock clock = this.kieSession.getSessionClock(); final MessageEvent pingEvent = new MessageEvent(MessageEvent.Type.sent, new Message("Ping")); this.kieSession.insert(pingEvent); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping2Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping2Event); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping3Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping3Event); clock.advanceTime(1, TimeUnit.SECONDS); this.kieSession.fireAllRules(); <START> Assertions.assertThat(this.events).as("The rule should have fired for 2 events").contains(ping2Event, ping3Event); <END> this.events.clear(); final MessageEvent pongEvent = new MessageEvent(MessageEvent.Type.sent, new Message("Pong")); this.kieSession.insert(pongEvent); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping4Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping4Event); clock.advanceTime(1, TimeUnit.SECONDS); this.kieSession.fireAllRules(); Assertions.assertThat(this.events).as("The rule should have fired for ping event only").contains(ping4Event); }</code><technical_language>Analogous, this is meant verify for ping2Event ping3Event, for pingEvent, I more correct previous version</technical_language>

Target:
private void populateAndVerifyTimeWindowCase(final KieBase kieBase) { final KieSessionConfiguration sessionConfiguration = KieSessionUtil.getKieSessionConfigurationWithClock(ClockTypeOption.get("pseudo"), null); this.initKieSession(kieBase, sessionConfiguration); final SessionPseudoClock clock = this.kieSession.getSessionClock(); final MessageEvent pingEvent = new MessageEvent(MessageEvent.Type.sent, new Message("Ping")); this.kieSession.insert(pingEvent); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping2Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping2Event); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping3Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping3Event); clock.advanceTime(1, TimeUnit.SECONDS); this.kieSession.fireAllRules(); Assertions.assertThat(this.events).as("The rule should have fired for 2 events").containsExactlyInAnyOrder(ping2Event, ping3Event); this.events.clear(); final MessageEvent pongEvent = new MessageEvent(MessageEvent.Type.sent, new Message("Pong")); this.kieSession.insert(pongEvent); clock.advanceTime(1, TimeUnit.SECONDS); final MessageEvent ping4Event = new MessageEvent(MessageEvent.Type.received, new Message("Ping")); this.kieSession.insert(ping4Event); clock.advanceTime(1, TimeUnit.SECONDS); this.kieSession.fireAllRules(); Assertions.assertThat(this.events).as("The rule should have fired for ping event only").contains(ping4Event); }