From 0f59b0d5335bba974afb4915b961e859546b32c2 Mon Sep 17 00:00:00 2001 From: Tomasz Lelek Date: Sun, 5 Feb 2017 14:13:45 +0100 Subject: [PATCH] BAEL-672 proper image id --- .../test/java/com/baeldung/weakhashmap/WeakHashMapTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();