@Test
public void numberOfMessageGroupsShouldNotExceedCacheSize() {

    final Set<String> groupIds = new HashSet<>();
    for (int i = 0; i < 10000; i++) {
        final String uuid = UUID.randomUUID().toString();
        groupIds.add(this.messageSender.getMessageGroupId(uuid));
    }
    final int actual = groupIds.size();
    assertTrue("Number of message groups should not exceed cache size " + this.messageGroupCacheSize,
            actual <= this.messageGroupCacheSize);
}