code: @Override
    public Behavior initialBehavior(Optional<BlogState> snapshotState) {
      if (snapshotState.isPresent() && !snapshotState.get().isEmpty()) {
        // behavior after snapshot must be restored by initialBehavior
        // if we have a non-empty BlogState we know that the initial
        // AddPost has been performed
        return becomePostAdded(snapshotState.get());
      } else {
        // behavior when no snapshot is used
        BehaviorBuilder b = newBehaviorBuilder(BlogState.EMPTY);
  
        // TODO define command and event handlers
  
        return b.build();
      }
    }
docs: #snapshot