public PrincipalCollection getPreviousPrincipals() {
        PrincipalCollection previousPrincipals = null;
        List<PrincipalCollection> stack = getRunAsPrincipalsStack();
        int stackSize = stack != null ? stack.size() : 0;
        if (stackSize > 0) {
            if (stackSize == 1) {
                previousPrincipals = this.principals;
            } else {
                //always get the one behind the current:
                assert stack != null;
                previousPrincipals = stack.get(1);
            }
        }
        return previousPrincipals;
    }
Returns {@code true} if this Subject is allowed to create sessions, {@code false} otherwise.

@return {@code true} if this Subject is allowed to create sessions, {@code false} otherwise.
@since 1.2
core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java