BAEL-1698 (latest) (#4138)

* Also needed

* BAEL-1698

* BAEL-1698
This commit is contained in:
Andrea Ligios 2018-04-30 00:17:26 +02:00 committed by Grzegorz Piwowarek
parent 94e0755cee
commit e725c023df
1 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,15 @@ public class MapMultipleValuesTest {
assertThat(map.get("key1").get(1)).isEqualTo("value2");
}
@Test
public void givenCollectionAsValueAndJava8_whenPuttingTwice_thenReturningCollection() {
Map<String, List<String>> map = new HashMap<>();
map.computeIfAbsent("key1", k -> new ArrayList<>()).add("value1");
map.computeIfAbsent("key1", k -> new ArrayList<>()).add("value2");
assertThat(map.get("key1").get(0)).isEqualTo("value1");
assertThat(map.get("key1").get(1)).isEqualTo("value2");
}
@Test
public void givenMultiValueMap_whenPuttingTwice_thenReturningValues() {
MultiMap<String, String> map = new MultiValueMap<>();