public Builder session(Session session) {
            if (session != null) {
                this.subjectContext.setSession(session);
            }
            return this;
        }
Ensures the {@code Subject} being built will use the specified {@link Session} instance.  Note that it is
more common to use the {@link #sessionId sessionId} builder method rather than having to construct a
{@code Session} instance for this method.

@param session the session to use as the {@code Subject}'s {@link Session}
@return this {@code Builder} instance for method chaining.
core/src/main/java/org/apache/shiro/subject/Subject.java