class AcHandling implements ProgressCheckFactory {

    @Override
    public ProgressCheck newInstance(final JsonObject config) {
        if (hasNonNull(config, keys().allowedModes())) {
            List<AccessControlHandling> allowedModes = mapArrayOfStrings(arrayOrEmpty(config, keys().allowedModes()),
                    compose1(String::toUpperCase, AccessControlHandling::valueOf), true);
            return new Check(ACHandlingLevelSet.EXPLICIT, allowedModes);
        } else if (hasNonNull(config, keys().levelSet())) {
            ACHandlingLevelSet levelSet = ACHandlingLevelSet.valueOf(config.getString(keys().levelSet()).toUpperCase());
            return new Check(levelSet, Collections.emptyList());
        } else {
            return new Check(DEFAULT_LEVEL_SET, Collections.emptyList());
        }
    }

}