private function applyModuleStateMapFilterFunction($moduleStateMap, $helpFunction, $moduleStateMapUpdateFunction)
    {
        if (!$helpFunction) {
            return $moduleStateMap;
        }

        foreach ($this->iterateThroughModuleStateMap($moduleStateMap) as list($groupId, $moduleIndex, $moduleData)) {
            $moduleStateMap[$groupId][$moduleIndex] = $moduleStateMapUpdateFunction($moduleData, $helpFunction);
        }

        return $moduleStateMap;
    }