From cc48f3bdcf11d44c3e5c1bce100085dbd3592523 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 20:07:29 +0200 Subject: [PATCH 1/2] update guava rangemap --- .../java/org/baeldung/guava/GuavaRangeMapUnitTest.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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..67a7d6a1f7 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,8 @@ 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 From dad9467f97b8fac1a9d77ba0d53270320e40cbf2 Mon Sep 17 00:00:00 2001 From: Loredana Date: Sun, 18 Nov 2018 20:09:39 +0200 Subject: [PATCH 2/2] fix formatting --- .../test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 67a7d6a1f7..c0c5efea23 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java +++ b/guava-collections/src/test/java/org/baeldung/guava/GuavaRangeMapUnitTest.java @@ -101,7 +101,8 @@ public class GuavaRangeMapUnitTest { final RangeMap experiencedSubRangeDesignationMap = experienceRangeDesignationMap.subRangeMap(Range.closed(4, 14)); assertNull(experiencedSubRangeDesignationMap.get(3)); - assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values().containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); + assertTrue(experiencedSubRangeDesignationMap.asMapOfRanges().values() + .containsAll(Arrays.asList("Executive Director", "Vice President", "Executive Director"))); }