public static <S extends BooleanSetting> BooleanSettingMapFactory<S> create(S[] settings) {
        Objects.requireNonNull(settings, "settings");

        BitSet defaultBits = new BitSet();
        for (int i = 0; i < settings.length; i++) {
            S setting = settings[i];

            // ensure ordinal has been correctly implemented
            if (setting.ordinal() != i) {
                throw new IllegalArgumentException("The ordinal of setting " + setting + " does not equal its array index. ordinal=" + setting.ordinal() + ", index=" + i);
            }

            if (setting.defaultState()) {
                defaultBits.set(i);
            }
        }
        return new BooleanSettingMapFactory<>(settings, defaultBits);
    }
Creates a new {@link BooleanSettingMapFactory} for the given {@link BooleanSetting}s.

<p>Factories should ideally be cached (stored in a static field) in the
setting class.</p>

@param settings the settings
@param <S> the class type
@return a new factory
helper/src/main/java/me/lucko/helper/setting/BooleanSettingMapFactory.java