Skip to content

Commit d5b3dc2

Browse files
committed
improve code
1 parent 13a7a57 commit d5b3dc2

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/main/java/de/tum/in/test/api/internal/sanitization/MultipleFailuresErrorSanitizer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package de.tum.in.test.api.internal.sanitization;
22

33
import java.util.*;
4-
import java.util.stream.Collectors;
54

65
import org.assertj.core.error.AssertJMultipleFailuresError;
76
import org.opentest4j.MultipleFailuresError;
@@ -22,8 +21,7 @@ public Throwable sanitize(Throwable t, MessageTransformer messageTransformer) {
2221
MultipleFailuresError mfe = (MultipleFailuresError) t;
2322
ThrowableInfo info = ThrowableInfo.getEssentialInfosSafeFrom(mfe).sanitize();
2423
// list is safe here because of defensive copying in MultipleFailuresError
25-
List<Throwable> failures = mfe.getFailures().stream().map(ThrowableSanitizer::sanitize)
26-
.collect(Collectors.toUnmodifiableList());
24+
List<Throwable> failures = mfe.getFailures().stream().map(ThrowableSanitizer::sanitize).toList();
2725
/*
2826
* Message already contains the failures and separating both is more difficult.
2927
* So we just pass the message constructed be the old object, as the new object

0 commit comments

Comments
 (0)