src/Whitelist.php
public static function forThe(
        MapsObjectsByIdentity $mapped,
        string ...$allowedClasses
    ): MapsObjectsByIdentity {
        foreach ($mapped->objects() as $object) {
            if (Whitelist::doesNotHave($object, $allowedClasses)) {
                $mapped = $mapped->removeThe($object);
            }
        }
        return new Whitelist($allowedClasses, $mapped);
    }
public static function forThe(
        MapsObjectsByIdentity $mapped,
        string ...$allowedClasses
    ): MapsObjectsByIdentity {
        foreach ($mapped->objects() as $object) {
            if (Whitelist::doesNotHave($object, $allowedClasses)) {
                $mapped = $mapped->removeThe($object);
            }
        }
        return new Whitelist($allowedClasses, $mapped);
    }
Constructs a whitelist for the identity map.

@param MapsObjectsByIdentity $mapped            The actual identity map.
@param string                ...$allowedClasses The whitelisted classes.
@return MapsObjectsByIdentity                   The wrapped identity map.
@throws NoSuchObject                            Probably won't though.