public String toString() {
        if (this.cachedToString == null) {
            Set<Object> principals = asSet();
            if (!CollectionUtils.isEmpty(principals)) {
                this.cachedToString = StringUtils.toString(principals.toArray());
            } else {
                this.cachedToString = "empty";
            }
        }
        return this.cachedToString;
    }
Returns a simple string representation suitable for printing.

@return a simple string representation suitable for printing.
@since 1.0
core/src/main/java/org/apache/shiro/subject/SimplePrincipalCollection.java