private function constructWhiteListForKey(array $whitelist, $key, $class)
    {
        if (isset($whitelist[$key]) && is_array($whitelist[$key])) {
            return array_map(function ($range) use ($class) {
                return new $class($range);
            }, array_values($whitelist[$key]));
        } else {
            return array();
        }
    }