public WebSubject buildWebSubject() {
            Subject subject = super.buildSubject();
            if (!(subject instanceof WebSubject)) {
                String msg = "Subject implementation returned from the SecurityManager was not a "
                        + WebSubject.class.getName() + " implementation.  Please ensure a Web-enabled SecurityManager "
                        + "has been configured and made available to this builder.";
                throw new IllegalStateException(msg);
            }
            return (WebSubject) subject;
        }
Returns {@link #buildSubject() super.buildSubject()}, but additionally ensures that the returned instance
is an {@code instanceof} {@link WebSubject WebSubject} and to support a type-safe method so a caller
does not have to cast.   Per the parent class's method JavaDoc, this method will return a new instance
each time it is called.

@return a new {@link WebSubject WebSubject} instance built by this {@code Builder}.
web/src/main/java/org/apache/shiro/web/subject/WebSubject.java