add bidimap key test

This commit is contained in:
Loredana Crusoveanu 2018-09-15 17:15:15 +03:00
parent af074ee8d3
commit 8d65e267e6
1 changed files with 9 additions and 0 deletions

View File

@ -42,4 +42,13 @@ public class BidiMapUnitTest {
map.put("key1", "value1");
assertEquals(map.getKey("value1"), "key1");
}
@Test
public void givenKeyValue_whenAddValue_thenReplaceFirstKey() {
BidiMap<String, String> map = new DualHashBidiMap<>();
map.put("key1", "value1");
map.put("key2", "value1");
assertEquals(map.size(), 1);
assertFalse(map.containsKey("key1"));
}
}