package helloworld;

import java.util.function.Consumer;

import org.requirementsascode.AbstractActor;
import org.requirementsascode.Model;

public class HelloUser {
  public static void main(String[] args) {
    GreetingService greeter = new GreetingService(HelloUser::saysHello);
    greeter.reactTo(new RequestHello("Joe"));
  }
  
  private static void saysHello(RequestHello requestsHello) {
    System.out.println("Hello, " + requestsHello.getUserName() + ".");
  }
}

class GreetingService extends AbstractActor {
  private static final Class<RequestHello> requestsHello = RequestHello.class;
  private final Consumer<RequestHello> saysHello;

  public GreetingService(Consumer<RequestHello> saysHello) {
    this.saysHello = saysHello;
  }

  @Override
  protected Model behavior() {
    Model model = Model.builder()
      .user(requestsHello).system(saysHello)
    .build();
    return model;
  }
}

class RequestHello {
  private final String userName;

  public RequestHello(String userName) {
    this.userName = userName;
  }

  public String getUserName() {
    return userName;
  }
}
@@ -85,58 +85,147 @@
 ode.
-AbstractActor;%0Aimport org.requirementsascode.Model
+Behavior;%0Aimport org.requirementsascode.BehaviorModel;%0Aimport org.requirementsascode.Model;%0Aimport org.requirementsascode.StatelessBehavior
 ;%0A%0Ap
@@ -304,26 +304,23 @@
 reet
-ingService
+erModel
  greeter
  = n
@@ -315,16 +315,21 @@
  greeter
+Model
  = new G
@@ -332,26 +332,23 @@
 ew Greet
-ingService
+erModel
 (HelloUs
@@ -363,16 +363,75 @@
 Hello);%0A
+    Behavior greeter = StatelessBehavior.of(greeterModel);%0A
     gree
@@ -446,28 +446,31 @@
 tTo(new 
+SayHello
 Request
-Hello
 (%22Joe%22))
@@ -510,28 +510,31 @@
 ysHello(
+SayHello
 Request
-Hello
  request
@@ -636,121 +636,42 @@
 reet
-ingService extends AbstractActor %7B%0A  private static final Class%3CRequestHello%3E requestsHello = RequestHello.class;
+erModel implements BehaviorModel %7B
 %0A  p
@@ -692,34 +692,36 @@
 onsumer%3C
+SayHello
 Request
-Hello
 %3E say
-s
 Hello;%0A%0A
@@ -738,18 +738,15 @@
 reet
-ingService
+erModel
 (Con
@@ -755,26 +755,28 @@
 mer%3C
+SayHello
 Request
-Hello
 %3E say
-s
 Hell
@@ -792,17 +792,16 @@
 this.say
-s
 Hello = 
@@ -799,25 +799,24 @@
 yHello = say
-s
 Hello;%0A  %7D%0A%0A
@@ -834,31 +834,25 @@
 %0A  p
-rotected Model behavior
+ublic Model model
 () %7B
@@ -898,29 +898,37 @@
   .user(
-requestsHello
+SayHelloRequest.class
 ).system
@@ -931,17 +931,16 @@
 stem(say
-s
 Hello)%0A 
@@ -983,28 +983,31 @@
 %0A%0Aclass 
+SayHello
 Request
-Hello
  %7B%0A  pri
@@ -1048,20 +1048,23 @@
 lic 
+SayHello
 Request
-Hello
 (Str

Adapt HelloWorld example