Merge pull request #5258 from eugenp/bidimap-test

add bidimap key test
This commit is contained in:
Loredana Crusoveanu 2018-09-15 17:39:39 +03:00 committed by GitHub
commit 06f66eda2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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"));
}
}