refactoring: Issues #2326 and #2325 (#2327)

* Fix comment typo #2325

* Minor enchancements to flyweight #2326

* Minor enchancements to flyweight #2326
This commit is contained in:
Stefanel Stan
2022-11-20 13:14:13 +00:00
committed by GitHub
parent 3a446f8e9c
commit a05cf33643
3 changed files with 7 additions and 10 deletions
@@ -28,6 +28,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.ArrayList;
import java.util.HashSet;
import org.junit.jupiter.api.Test;
/**
@@ -55,8 +56,6 @@ class AlchemistShopTest {
// There are 13 potion instances, but only 5 unique instance types
assertEquals(13, allPotions.size());
assertEquals(5, allPotions.stream().map(System::identityHashCode).distinct().count());
assertEquals(5, new HashSet<>(allPotions).size());
}
}