Merge pull request #5722 from eugenp/update-guava-test

update guava rangemap
This commit is contained in:
Loredana Crusoveanu 2018-11-18 20:19:05 +02:00 committed by GitHub
commit 3237f36c2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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<Integer, String> 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