diff --git a/core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapTest.java b/core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapTest.java index fbeb364ab6..7b34c6b316 100644 --- a/core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapTest.java +++ b/core-java/src/test/java/com/baeldung/weakhashmap/WeakHashMapTest.java @@ -15,13 +15,13 @@ public class WeakHashMapTest { public void givenWeakHashMap_whenCacheValueThatHasNoReferenceToIt_GCShouldReclaimThatObject() { //given WeakHashMap map = new WeakHashMap<>(); - BigImage bigImage = new BigImage("foo"); + BigImage bigImage = new BigImage("image_id"); UniqueImageName imageName = new UniqueImageName("name_of_big_image"); map.put(imageName, bigImage); assertTrue(map.containsKey(imageName)); - //when big image is not in use anymore + //when big image key is not reference anywhere imageName = null; System.gc();