diff --git a/core/src/test/java/com/github/weisj/darklaf/core/test/IconCacheTest.java b/core/src/test/java/com/github/weisj/darklaf/core/test/IconCacheTest.java index 1a7dd6b3..498f640b 100644 --- a/core/src/test/java/com/github/weisj/darklaf/core/test/IconCacheTest.java +++ b/core/src/test/java/com/github/weisj/darklaf/core/test/IconCacheTest.java @@ -40,8 +40,9 @@ class IconCacheTest implements NonThreadSafeTest { IconSet.ICON_LOADER.clearCache(); UIDefaults defaults = new DarkLaf().getDefaults(); Assertions.assertFalse(IconSet.ICON_LOADER.isCacheEmpty()); + int size = IconSet.ICON_LOADER.cacheSize(); defaults.clear(); - waitForGarbageCollection(() -> !IconSet.ICON_LOADER.isCacheEmpty()); + waitForGarbageCollection(() -> IconSet.ICON_LOADER.cacheSize() == size); } @SuppressWarnings({"unused"}) diff --git a/utils/src/test/java/com/github/weisj/darklaf/util/cache/SoftCacheTest.java b/utils/src/test/java/com/github/weisj/darklaf/util/cache/SoftCacheTest.java index b8b481f3..bcfa2dae 100644 --- a/utils/src/test/java/com/github/weisj/darklaf/util/cache/SoftCacheTest.java +++ b/utils/src/test/java/com/github/weisj/darklaf/util/cache/SoftCacheTest.java @@ -45,9 +45,10 @@ class SoftCacheTest { Assertions.assertEquals(count, hardReferences.size()); Assertions.assertEquals(count, cache.size()); + int cacheSize = cache.size(); hardReferences.clear(); - waitForGarbageCollection(() -> !cache.isEmpty()); + waitForGarbageCollection(() -> cache.size() == cacheSize); } @SuppressWarnings({"unused"})