void (IntObjectMap<Object> map, @NotNull Runnable put) { assertTrue(map.isEmpty()); assertEquals(0, map.size()); put.run(); strong = new Object(); //noinspection SizeReplaceableByIsEmpty do { map.put(RANDOM_INT, strong); // to run processQueues(); assertFalse(map.isEmpty()); map.remove(RANDOM_INT); assertNull(map.get(RANDOM_INT)); GCUtil.tryGcSoftlyReachableObjects(() -> map.isEmpty()); } while (map.size() != 0); assertTrue(map.isEmpty()); assertEquals(0, map.size()); map.put(RANDOM_INT, this); assertEquals(1, map.size()); map.clear(); assertEquals(0, map.size()); assertNull(map.get(RANDOM_INT)); }