diff --git a/core-java-modules/core-java-collections-maps-3/src/test/java/com/baeldung/map/hashmap/loadfactor/HashMapLoadFactorUnitTest.java b/core-java-modules/core-java-collections-maps-3/src/test/java/com/baeldung/map/hashmap/loadfactor/HashMapLoadFactorUnitTest.java index 89e2a189fe..94967a4905 100644 --- a/core-java-modules/core-java-collections-maps-3/src/test/java/com/baeldung/map/hashmap/loadfactor/HashMapLoadFactorUnitTest.java +++ b/core-java-modules/core-java-collections-maps-3/src/test/java/com/baeldung/map/hashmap/loadfactor/HashMapLoadFactorUnitTest.java @@ -10,8 +10,8 @@ public class HashMapLoadFactorUnitTest { @Test public void whenCreateMapWithDefaultParam_thenSucces() { - Map mapWithDefaultParams = new HashMap(); - mapWithDefaultParams.put("1", "One"); + Map mapWithDefaultParams = new HashMap<>(); + mapWithDefaultParams.put("1", "one"); mapWithDefaultParams.put("2", "two"); mapWithDefaultParams.put("3", "three"); mapWithDefaultParams.put("4", "four"); @@ -22,8 +22,8 @@ public class HashMapLoadFactorUnitTest { @Test public void whenCreateMapWithInitialCapacity_thenSucces() { - Map mapWithInitialCapacity = new HashMap(5); - mapWithInitialCapacity.put("1", "One"); + Map mapWithInitialCapacity = new HashMap<>(5); + mapWithInitialCapacity.put("1", "one"); mapWithInitialCapacity.put("2", "two"); mapWithInitialCapacity.put("3", "three"); @@ -32,7 +32,7 @@ public class HashMapLoadFactorUnitTest { @Test public void whenCreateMapWithInitialCapacityAndLF_thenSucces() { - Map mapWithInitialCapacityAndLF = new HashMap(5, 0.5f); + Map mapWithInitialCapacityAndLF = new HashMap<>(5, 0.5f); mapWithInitialCapacityAndLF.put("1", "one"); mapWithInitialCapacityAndLF.put("2", "two"); mapWithInitialCapacityAndLF.put("3", "three");