File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/test/java/net/openhft/smoothie Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 1717package net .openhft .smoothie ;
1818
1919import com .google .common .collect .ImmutableSet ;
20+ import org .jetbrains .annotations .Nullable ;
2021import org .junit .Test ;
2122
2223import static org .junit .Assert .assertEquals ;
@@ -44,4 +45,21 @@ public int hashCode() {
4445 return 0 ;
4546 }
4647 }
48+
49+ @ Test
50+ public void shiftRemoveEarlyBreakTest () {
51+ SmoothieMap <Long , Integer > map = new SmoothieMap <Long , Integer >() {
52+ @ Override
53+ protected long keyHashCode (@ Nullable Object key ) {
54+ return ((Long ) key ).longValue ();
55+ }
56+ };
57+
58+ map .put (0L , 0 );
59+ map .put (2L << (64 - Segment .LOG_HASH_TABLE_SIZE ), 2 );
60+ map .put (3L << (64 - Segment .LOG_HASH_TABLE_SIZE ), 3 );
61+
62+ map .removeIf ((k , v ) -> true );
63+ assertEquals (0 , map .size ());
64+ }
4765}
You can’t perform that action at this time.
0 commit comments