diff --git a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiSetUnitTest.java b/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiSetUnitTest.java index b3f097cf9a..3d75cc38a3 100644 --- a/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiSetUnitTest.java +++ b/guava-collections/src/test/java/org/baeldung/guava/GuavaMultiSetUnitTest.java @@ -30,7 +30,7 @@ public class GuavaMultiSetUnitTest { @Test public void givenMultiSet_whenSetCount_shouldReturnCorrectCount() { Multiset bookStore = HashMultiset.create(); - bookStore.setCount("Potter", 50); //add 50 to the count + bookStore.setCount("Potter", 50); assertThat(bookStore.count("Potter")).isEqualTo(50); } @@ -50,24 +50,18 @@ public class GuavaMultiSetUnitTest { @Test public void givenMap_compareMultiSetOperations() { Map bookStore = new HashMap<>(); - bookStore.put("Potter", 1); - bookStore.put("Potter", 2); bookStore.put("Potter", 3); assertThat(bookStore.containsKey("Potter")).isTrue(); assertThat(bookStore.get("Potter")).isEqualTo(3); + bookStore.put("Potter", 2); + assertThat(bookStore.get("Potter")).isEqualTo(2); + bookStore.put("Potter", null); assertThat(bookStore.containsKey("Potter")).isTrue(); bookStore.put("Potter", -1); assertThat(bookStore.containsKey("Potter")).isTrue(); - - bookStore.put("Potter", 2); - assertThat(bookStore.containsKey("Potter")).isTrue(); - assertThat(bookStore.get("Potter")).isEqualTo(2); - - bookStore.put("Potter", 52); - assertThat(bookStore.get("Potter")).isEqualTo(52); } }