Libraryless. Click here for Pure Java version (5279L/30K).
svoid test_CompactHashMap() { new CompactHashMap<S> map1; new HashMap<S> map2; embedded void check { assertEqualsVerbose(map2.size(), map1.size()); assertEquals(sorted(keys(map2)), sorted(keys(map1))); assertEquals(sorted(values(map2)), sorted(values(map1))); for (S key : keys(map1)) assertEquals(map2.get(key), map1.get(key)); assertNull(map1.get("unknown")); } check(); repeat 100 { repeat 10 { putInTwoMaps(map1, map2, aGlobalID(), aGlobalID()); } removeFromTwoMaps(map1, map2, random(keys(map2))); check(); } }
Began life as a copy of #1013304
download show line numbers debug dex old transpilations
Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1034065 |
Snippet name: | test_CompactHashMap (OK) |
Eternal ID of this version: | #1034065/1 |
Text MD5: | 8e42d27660e490cfc50f9dc0cb1f5922 |
Transpilation MD5: | cd2d3fabc73fa4c39a668c806ba1067d |
Author: | stefan |
Category: | javax |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-20 01:29:10 |
Source code size: | 604 bytes / 22 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 110 / 168 |
Referenced in: | [show references] |