diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java index 81ba72373c..c0c5efea23 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java @@ -2,6 +2,9 @@ package org.baeldung.guava; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.util.Arrays; import java.util.Map; import org.junit.Test; import com.google.common.collect.ImmutableRangeMap; @@ -98,8 +101,9 @@ public class GuavaRangeMapUnitTest { final RangeMap experiencedSubRangeDesignationMap = experienceRangeDesignationMap.subRangeMap(Range.closed(4, 14)); assertNull(experiencedSubRangeDesignationMap.get(3)); - assertEquals("Executive Director", experiencedSubRangeDesignationMap.get(14)); - assertEquals("Vice President", experiencedSubRangeDesignationMap.get(7)); + assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values() + .containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); + } @Test