code: private Behavior becomePostAdded(BlogState newState) {
      BehaviorBuilder b = newBehaviorBuilder(newState);
  
      //#read-only-command-handler
      b.setReadOnlyCommandHandler(GetPost.class, (cmd, ctx) ->
        ctx.reply(state().getContent().get()));
      //#read-only-command-handler
  
      //#reply
      b.setCommandHandler(ChangeBody.class,
          (cmd, ctx) -> ctx.thenPersist(new BodyChanged(entityId(), cmd.getBody()), evt ->
            ctx.reply(Done.getInstance())));
      //#reply
  
      b.setEventHandler(BodyChanged.class, evt -> state().withBody(evt.getBody()));
  
      return b.build();
    }
docs: #snapshot