diff --git a/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/accessmodifiers/PublicAccessModifierUnitTest.java b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/accessmodifiers/PublicAccessModifierUnitTest.java index 0eca4b4222..c9664283a7 100644 --- a/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/accessmodifiers/PublicAccessModifierUnitTest.java +++ b/core-java-modules/core-java-lang-oop-2/src/test/java/com/baeldung/accessmodifiers/PublicAccessModifierUnitTest.java @@ -11,7 +11,9 @@ import java.math.BigDecimal; import java.sql.Connection; import java.sql.DriverManager; import java.sql.SQLException; +import java.util.HashMap; import java.util.List; +import java.util.Map; @TestInstance(Lifecycle.PER_CLASS) public class PublicAccessModifierUnitTest { @@ -25,7 +27,20 @@ public class PublicAccessModifierUnitTest { public void whenUsingIntegerMaxValueField_maxPossibleIntValueIsReturned() { assertEquals(2147483647, Integer.MAX_VALUE); //static field } + + @Test + public void whenUsingEntrySet_keyValuePairsAreReturned() { + Map mapObject = new HashMap(); + mapObject.put("name", "Alex"); + + for(Map.Entry entry : mapObject.entrySet()) { + assertEquals("name", entry.getKey()); + assertEquals("Alex", entry.getValue()); + } + + } + @Test public void whenUsingStringToLowerCase_stringTurnsToLowerCase() { assertEquals("alex", "ALEX".toLowerCase());