diff --git a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java index 5200388af8881..5c4cdadbfecf4 100644 --- a/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java +++ b/server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java @@ -2546,7 +2546,7 @@ private static class MockMTAppender extends AbstractAppender { private final List messages = Collections.synchronizedList(new ArrayList<>()); List messages() { - return messages; + return List.copyOf(messages); } MockMTAppender(final String name) throws IllegalAccessException {