Java Set methods are too strict with type

I would expect the following 2 examples to work the same in CFML for set intersection. That is, to have a set containing only 2413.

<cfscript>
    arr1 = [2434, 2413];
    arr2 = [2413];

    writeDump(arr1);
    writeDump(arr2);

    hs1 = createObject("java", "java.util.HashSet").init(arr1);
    hs2 = createObject("java", "java.util.HashSet").init(arr2);

    hs1.retainAll(hs2);

    writeDump(hs1.toArray());
</cfscript>
<cfscript>
    arr1 = [2434, 2413];
    foo = {
        2413: "bar"
    }
    arr2 = structKeyArray(foo);
    
    writeDump(arr1);
    writeDump(arr2);
    
    hs1 = createObject("java", "java.util.HashSet").init(arr1);
    hs2 = createObject("java", "java.util.HashSet").init(arr2);

    hs1.retainAll(hs2);

    writeDump(hs1.toArray());
</cfscript>

However, it seems that structKeyArray returns an array of strings while the array literals are of numbers, which Java strictly adheres to in its comparison. This appears to be the case in both ACF and Lucee.