+Who sets the initial and next states?
A new document has not been submitted, so it starts as a draft. The field initializer private DocumentState state = new DraftState(null); creates the initial state object for each document. Here, null means that the first draft has no rejection reason, not that the document has no state.
DocumentState defines the requests shared by the state implementations, while the state field refers to the one object currently handling them. Its first object is a DraftState, so the document forwards Submit() to that implementation.
The operation handling an event chooses the next state. When the caller requests Submit(), DraftState.Submit() executes document.state = new InReviewState();. Subsequent requests go to that new review state. Approval replaces it with a PublishedState in InReviewState.Approve(), while InReviewState.Reject(reason) replaces it with a DraftState carrying the reason. Time passing alone does not change the state.
There is no separate assignment to Stage. The getter Stage => state.Stage reads the current object's value, so replacing the state object also changes the reported stage. Callers cannot set state directly; they must use the permitted requests. Loading a saved document and restoring its state is outside this example.