@Test
public void testRemoveIf() {

   MessageGroups<String> messageGroups = new BucketMessageGroups<>(10);
   messageGroups.put(toGroupBucketIntKey(1), "world1");
   messageGroups.put(toGroupBucketIntKey(2), "world2");
   messageGroups.put(toGroupBucketIntKey(3), "world1");
   messageGroups.put(toGroupBucketIntKey(4), "world2");
   messageGroups.put(toGroupBucketIntKey(5), "world1");
   messageGroups.put(toGroupBucketIntKey(6), "world2");
   messageGroups.put(toGroupBucketIntKey(7), "world1");
   messageGroups.put(toGroupBucketIntKey(8), "world2");
   messageGroups.put(toGroupBucketIntKey(9), "world3");
   messageGroups.put(toGroupBucketIntKey(10), "world4");
   assertEquals(10, messageGroups.size());
   messageGroups.removeIf("world1"::equals);
   assertEquals(6, messageGroups.size());
   messageGroups.removeIf("world4"::equals);
   assertEquals(5, messageGroups.size());
   messageGroups.removeIf("world3"::equals);
   assertEquals(4, messageGroups.size());
   messageGroups.removeIf("world2"::equals);
   assertEquals(0, messageGroups.size());
}