package helloworld;

import static org.requirementsascode.UseCaseModelBuilder.newBuilder;

import java.util.function.Consumer;

import org.requirementsascode.UseCaseModel;
import org.requirementsascode.UseCaseModelBuilder;
import org.requirementsascode.UseCaseModelRunner;

public class HelloWorld01_PrintHelloUserExample {	
	
	public UseCaseModel buildWith(UseCaseModelBuilder modelBuilder) {
		UseCaseModel useCaseModel = 
			modelBuilder.useCase("Get greeted")
				.basicFlow()
					.step("S1").system(greetUser())
				.build();
		return useCaseModel;
	}

	private Consumer<UseCaseModelRunner> greetUser() {
		return r -> System.out.println("Hello, User.");
	}
	
	public static void main(String[] args){		
		HelloWorld01_PrintHelloUserExample example = new HelloWorld01_PrintHelloUserExample();
		example.start();
	}

	private void start() {
		UseCaseModelRunner useCaseModelRunner = new UseCaseModelRunner();
		UseCaseModel useCaseModel = buildWith(newBuilder());
		useCaseModelRunner.run(useCaseModel);
	}
}
@@ -88,45 +88,8 @@
 r;%0A%0A
-import java.util.function.Consumer;%0A%0A
 impo
@@ -461,16 +461,22 @@
 .system(
+this::
 greetUse
@@ -476,18 +476,16 @@
 reetUser
-()
 )%0A%09%09%09%09.b
@@ -532,17 +532,23 @@
 ate 
-Consumer%3C
+void greetUser(
 UseC
@@ -565,38 +565,21 @@
 nner
-%3E greetUs
+ runn
 er
-(
 ) %7B%0A%09%09
-return r -%3E 
 Syst

Refactor to use method references