public static ViewPoolingResetMode isViewPooling(FacesContext context) {
        if (context.getViewRoot() != null) {
            Object mode = context.getViewRoot().getAttributes().get("oam.view.resetSaveStateMode");

            if (Objects.equals(mode, 1)) {
                return ViewPoolingResetMode.SOFT;
            }
            if (Objects.equals(mode, 2)) {
                return ViewPoolingResetMode.HARD;
            }
        }
        return ViewPoolingResetMode.OFF;
    }
Tries to retrieve value from stateHelper by key first. If the value is not present (or is null),
then it is retrieved from defaultValueSupplier.

Should be removed when {@link StateHelper} is extended with similar functionality.
(see https://github.com/jakartaee/faces/issues/2024 for details)
@param stateHelper The stateHelper to try to retrieve value from
@param key The key under which value is stored in the stateHelper
@param defaultValueSupplier The object, from which default value is retrieved
@param <T> the expected type of returned value
@return value from stateHelper or defaultValueSupplier
primefaces/src/main/java/org/primefaces/util/ComponentUtils.java