private void clearMVSKeys(Set<MVSKey> keysToRemove, boolean reset, Consumer<String> clientIdConsumer) {
            String currentViewId = getFacesContext().getViewRoot().getViewId();

            Set<MVSKey> mvsKeys = getMVSKeys();
            for (MVSKey mvsKey : keysToRemove) {
                if (!mvsKeys.remove(mvsKey)) {
                    LOGGER.log(Level.WARNING,
                            "Multiview state for viewId: \"{0}\" and clientId \"{1}\" not found",
                            new Object[]{mvsKey.viewId, mvsKey.clientId});
                    continue;
                }

                if (reset && mvsKey.viewId.equals(currentViewId)) {
                    reset(mvsKey.clientId);
                }

                if (clientIdConsumer != null) {
                    clientIdConsumer.accept(mvsKey.clientId);
                }
            }
        }
Gets multiview state attached to a component in a specific view.

@param viewId viewId of a page
@param clientId clientId of a component
@param <T> bean state generic

@return multiview state bean attached to a component or null
primefaces/src/main/java/org/primefaces/PrimeFaces.java