Some SimpleMessageGroupTests.testPerformance() optimization

This commit is contained in:
Artem Bilan
2024-12-06 09:27:02 -05:00
parent 2cf83b5311
commit 5313c42e17

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2009-2023 the original author or authors.
* Copyright 2009-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -106,8 +106,9 @@ public class SimpleMessageGroupTests {
SimpleMessageGroup group = new SimpleMessageGroup(messages, this.key);
StopWatch watch = new StopWatch();
watch.start();
Collection<Message<?>> messagesInGroup = group.getMessages();
for (Message<?> message : messages) {
assertThat(group.getMessages().contains(message)).isTrue();
assertThat(messagesInGroup.contains(message)).isTrue();
}
watch.stop();
assertThat(watch.getTotalTimeMillis()).isLessThan(5000);