public void setRealms(Collection<Realm> realms) {
        if (realms == null) {
            throw new IllegalArgumentException("Realms collection argument cannot be null.");
        }
        if (realms.isEmpty()) {
            throw new IllegalArgumentException("Realms collection argument cannot be empty.");
        }
        this.realms = realms;
        afterRealmsSet();
    }
Sets the realms managed by this <tt>SecurityManager</tt> instance.

@param realms the realms managed by this <tt>SecurityManager</tt> instance.
@throws IllegalArgumentException if the realms collection is null or empty.
core/src/main/java/org/apache/shiro/mgt/RealmSecurityManager.java