Skip to content

Commit d98b696

Browse files
myluckagainpivovarit
authored andcommitted
BAEL-1736 fix (eugenp#4271)
1 parent 087f0c2 commit d98b696

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎core-java-8/src/test/java/com/baeldung/hashtable/HashtableUnitTest.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public void whenCompute_thenForAllKeys() {
233233
Hashtable<String, Integer> table = new Hashtable<String, Integer>();
234234
String[] animals = { "cat", "dog", "dog", "cat", "bird", "mouse", "mouse" };
235235
for (String animal : animals) {
236-
table.compute(animal, (key, value) -> (value == null ? Integer.valueOf(1) : Integer.valueOf(value) + 1));
236+
table.compute(animal, (key, value) -> (value == null ? 1 : value + 1));
237237
}
238238
assertThat(table.values(), hasItems(2, 2, 2, 1));
239239

@@ -271,4 +271,4 @@ public void whenReplaceall_thenNoIterationNeeded() {
271271

272272
assertThat(table.values(), hasItems("cat - a small domesticated carnivorous mammal", "dog - another animal"));
273273
}
274-
}
274+
}

0 commit comments

Comments
 (0)