In Qi4j there is the option to use Constraints, which are further restrictions on the parameters. This is implemented by having an annotation that describes what the Constraint does, and then an implementation class that checks whether a specific value fulfills the Constraint or not.
There are a number of pre-written constraints in Qi4j which you can use, and checking for null values is one of them. Since the HelloWorld code does this manually, let's replace it with the Constraint to simplify the code and better document the interface so that clients know what is expected.
The only thing you have to do is add the annotation @NotNull to the method parameters you want to constrain. The annotation has a default implementation declared in it by using the @Constraints annotation. You can either just use this, which is the common case, or override it by declaring your own @Constraints annotation in the Composite type.
Steps for this tutorial:
If you have successfully completed the task, you should end up with the following artifacts;
HelloWorld.java
HelloWorldBehaviour.java
HelloWorldBehaviorConcern.java
HelloWorldBehaviourMixin.java
HelloWorldComposite.java
HelloWorldState.java
HelloWorldStateMixin.java