function test_canDeployWithCollidingSelector() public {
    // Getting the colliding selectors that point to different implementations.
    bytes4 selectorOne = bytes4(keccak256(bytes("func_2093253501(bytes)")));
    bytes4 selectorTwo = bytes4(keccak256(bytes("transfer(address,uint256)")));
    
    bytes4[] memory collidingSelectors = new bytes4[](2);
    address[] memory nonCollidingPlugins = new address[](2);

    collidingSelectors[0] = selectorOne;
    nonCollidingPlugins[0] = address(0xdead1);

    collidingSelectors[1] = selectorTwo;
    nonCollidingPlugins[1] = address(0xdead2);

    // Deploying a vault
    vault = alice.registry.createFor(
        merkleRoot,
        alice.addr,
        nonCollidingPlugins,
        collidingSelectors
    );
    token = registry.fNFT();
    setUpFERC1155(alice, token);

    assertEq(IVault(vault).owner(), alice.addr);
    assertEq(fERC1155.controller(), address(this));

    // Both selectors point to the same address of implementation.
    assertEq(IVault(vault).methods(selectorOne), address(0xdead2));
    assertEq(IVault(vault).methods(selectorTwo), address(0xdead2));
}
function test_canOverwritePlugin() public {
        // Generating the colliding selectors
        bytes4 selectorOne = bytes4(keccak256(bytes("collate_propagate_storage(bytes16)")));
        bytes4 selectorTwo = bytes4(keccak256(bytes("burn(uint256)")));
        
        bytes4[] memory collidingSelectors = new bytes4[](1);
        address[] memory nonCollidingPlugins = new address[](1);

        collidingSelectors[0] = selectorOne;
        nonCollidingPlugins[0] = address(0xdead1);

        // Deploying a vault
        vault = alice.registry.createFor(
            merkleRoot,
            alice.addr,
            nonCollidingPlugins,
            collidingSelectors
        );
        token = registry.fNFT();
        setUpFERC1155(alice, token);

        assertEq(IVault(vault).owner(), alice.addr);
        assertEq(fERC1155.controller(), address(this));

        // Checking that the selector one was properly installed and that points to 0xdead1
        assertEq(IVault(vault).methods(selectorOne), address(0xdead1));

        // At any time the owner will be able to overwrite the plugin by clashing with the existing one.
        // this can be used to frontrun a call that targets selectorOne and modify its implementation.
        vm.startPrank(alice.addr);
        bytes4[] memory clashingSelector = new bytes4[](1);
        address[] memory newPluginAddress = new address[](1);

        clashingSelector[0] = selectorTwo; // The one declared before.
        newPluginAddress[0] = address(0xdead2);

        IVault(vault).install(clashingSelector, newPluginAddress);
        vm.stopPrank();

        // Checking that the selector was indeed overwritten and now is pointing to 0xdead2
        assertEq(IVault(vault).methods(selectorOne), address(0xdead2));
        assertEq(IVault(vault).methods(selectorTwo), address(0xdead2)); // Redundant assertion.
        
        vm.startPrank(alice.addr);
        // Also, there is no need to have a clashing function with other name.
        // It is just enough to use the same function name as before with a new address.
        clashingSelector[0] = selectorOne;
        newPluginAddress[0] = address(0xdead3);

        IVault(vault).install(clashingSelector, newPluginAddress);
        vm.stopPrank();
        assertEq(IVault(vault).methods(selectorOne), address(0xdead3));
        assertEq(IVault(vault).methods(selectorTwo), address(0xdead3));            
    }
