As TMap doesn’t have a equal operator you have to do all equalities
also your code is wrong, it will return true at the fist item from Test 1 contained in Test2 ( i don’t know if that’s what you were looking but from your explanation i don’t think )
also, contain + findRef is doing 2 time the hashMap search,might be better to do a ‘Find’ and compare value
does it have to contains all the same keys ? or do they also need to be in the same order ? ( faster to fail so it’s better)
anyway, if it’s a code that is only called sometimes it’s ok to have some not so optimised code, if it’s call very often for many objects, you might want to think to and other way to do it (i can think of an enum based array ?)