Skip to content

Commit

Permalink
Fix flaky test in ObjectUtilsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
balasukesh authored and Createsequence committed Nov 10, 2023
1 parent b73311a commit 679c3f8
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import org.junit.Test;

import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -51,8 +52,9 @@ public void get() {
Assert.assertNull(ObjectUtils.get(Arrays.asList(null, null, 3), -1));
// if target is map
Assert.assertEquals((Integer)3, ObjectUtils.get(
Stream.of(1, 2, 3).collect(Collectors.toMap(Function.identity(), Function.identity())), 2
));
Stream.of(1, 2, 3)
.collect(Collectors.toMap(Function.identity(), Function.identity(), (existing, replacement) -> existing, LinkedHashMap::new)), 2
));
}

@Test
Expand Down

0 comments on commit 679c3f8

Please sign in to comment.