private void addToRealms(Collection<Realm> realms, RealmFactory factory) {
        LifecycleUtils.init(factory);
        Collection<Realm> factoryRealms = factory.getRealms();
        //SHIRO-238: check factoryRealms (was 'realms'):
        if (!CollectionUtils.isEmpty(factoryRealms)) {
            realms.addAll(factoryRealms);
        }
    }
Creates a new instance.  See the {@link #getInstance()} JavaDoc for detailed explanation of how an INI
source will be resolved to use to build the instance.
core/src/main/java/org/apache/shiro/ini/IniSecurityManagerFactory.java