diff --git a/experimental/pom.xml b/experimental/pom.xml
index 019a15b8..9882957d 100644
--- a/experimental/pom.xml
+++ b/experimental/pom.xml
@@ -49,5 +49,6 @@
lambda-fluent
fluent
model
+ test
\ No newline at end of file
diff --git a/experimental/test/pom.xml b/experimental/test/pom.xml
new file mode 100644
index 00000000..3b24140f
--- /dev/null
+++ b/experimental/test/pom.xml
@@ -0,0 +1,43 @@
+
+ 4.0.0
+
+ io.serverlessworkflow
+ serverlessworkflow-experimental
+ 8.0.0-SNAPSHOT
+
+ serverlessworkflow-experimental-test
+ Serverless Workflow :: Experimental :: Test
+
+
+ org.junit.jupiter
+ junit-jupiter-engine
+ test
+
+
+ org.mockito
+ mockito-core
+ test
+
+
+ org.assertj
+ assertj-core
+ test
+
+
+ io.serverlessworkflow
+ serverlessworkflow-experimental-fluent-func
+ test
+
+
+ io.serverlessworkflow
+ serverlessworkflow-experimental-lambda
+ test
+
+
+ io.serverlessworkflow
+ serverlessworkflow-impl-model
+ ${project.version}
+ test
+
+
+
\ No newline at end of file
diff --git a/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java b/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java
new file mode 100644
index 00000000..3058eaa2
--- /dev/null
+++ b/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/FuncEventFilterTest.java
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2020-Present The Serverless Workflow Specification Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.serverlessworkflow.fluent.test;
+
+import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.emitJson;
+import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.listen;
+import static io.serverlessworkflow.fluent.func.dsl.FuncDSL.toOne;
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.fasterxml.jackson.databind.node.ArrayNode;
+import io.serverlessworkflow.api.types.Workflow;
+import io.serverlessworkflow.fluent.func.FuncWorkflowBuilder;
+import io.serverlessworkflow.impl.WorkflowApplication;
+import io.serverlessworkflow.impl.WorkflowModel;
+import java.util.Collection;
+import java.util.Map;
+import java.util.concurrent.CompletableFuture;
+import org.junit.jupiter.api.Test;
+
+/**
+ * Tests for the Event Filter DSL specification. Verifies that the fluent builder correctly wires
+ * the payload parsing and contextual lambdas into the final Workflow definitions.
+ */
+class FuncEventFilterTest {
+
+ @Test
+ void testListenToOneCollection() {
+ runIt(
+ FuncWorkflowBuilder.workflow("listenToOneReviewCol")
+ .tasks(
+ listen("waitReview", toOne("org.acme.test.review"))
+ .outputAs((Collection> node) -> node.iterator().next()))
+ .build());
+ }
+
+ @Test
+ void testListenToOneNode() {
+ runIt(
+ FuncWorkflowBuilder.workflow("listenToOneReviewNode")
+ .tasks(
+ listen("waitReview", toOne("org.acme.test.review"))
+ .outputAs((ArrayNode node) -> node.get(0)))
+ .build());
+ }
+
+ private Workflow reviewEmitter() {
+ return FuncWorkflowBuilder.workflow("emitReview")
+ .tasks(emitJson("draftReady", "org.acme.test.review", Review.class))
+ .build();
+ }
+
+ private void runIt(Workflow listen) {
+ Review review = new Review("Torrente", "espectacular", 5);
+ try (WorkflowApplication app = WorkflowApplication.builder().build()) {
+ CompletableFuture waiting =
+ app.workflowDefinition(listen).instance(Map.of()).start();
+ app.workflowDefinition(reviewEmitter()).instance(review).start().join();
+ assertThat(waiting.join().as(Review.class).orElseThrow()).isEqualTo(review);
+ }
+ }
+}
diff --git a/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/Review.java b/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/Review.java
new file mode 100644
index 00000000..ab16a454
--- /dev/null
+++ b/experimental/test/src/test/java/io/serverlessworkflow/fluent/test/Review.java
@@ -0,0 +1,18 @@
+/*
+ * Copyright 2020-Present The Serverless Workflow Specification Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package io.serverlessworkflow.fluent.test;
+
+record Review(String title, String description, int rating) {}
diff --git a/impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java b/impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java
index d6e9c6b9..4bc3b2d5 100644
--- a/impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java
+++ b/impl/model/src/main/java/io/serverlessworkflow/impl/model/jackson/JacksonModelCollection.java
@@ -38,6 +38,9 @@ public class JacksonModelCollection implements WorkflowModelCollection {
@Override
public Optional as(Class clazz) {
+ if (clazz.equals(Collection.class)) {
+ return Optional.of(clazz.cast(this));
+ }
return clazz.isAssignableFrom(ArrayNode.class)
? Optional.of(clazz.cast(node))
: Optional.empty();