[BAEL-4715] Java HashMap Load Factor

Fixed HashMap creation and few entries
This commit is contained in:
MeenaGawande 2021-02-02 11:25:34 +05:30
parent d3156e1034
commit a50cec2882
1 changed files with 5 additions and 5 deletions

View File

@ -10,8 +10,8 @@ public class HashMapLoadFactorUnitTest {
@Test
public void whenCreateMapWithDefaultParam_thenSucces() {
Map<String, String> mapWithDefaultParams = new HashMap<String, String>();
mapWithDefaultParams.put("1", "One");
Map<String, String> 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<String, String> mapWithInitialCapacity = new HashMap<String, String>(5);
mapWithInitialCapacity.put("1", "One");
Map<String, String> 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<String, String> mapWithInitialCapacityAndLF = new HashMap<String, String>(5, 0.5f);
Map<String, String> mapWithInitialCapacityAndLF = new HashMap<>(5, 0.5f);
mapWithInitialCapacityAndLF.put("1", "one");
mapWithInitialCapacityAndLF.put("2", "two");
mapWithInitialCapacityAndLF.put("3", "three");