Commit e1611287 authored by freekry's avatar freekry Committed by Stephane Nicoll

Simplify some code

See gh-18077
parent 58734873
...@@ -54,10 +54,7 @@ class IncludeExcludeGroupMemberPredicate implements Predicate<String> { ...@@ -54,10 +54,7 @@ class IncludeExcludeGroupMemberPredicate implements Predicate<String> {
if (names == null) { if (names == null) {
return Collections.emptySet(); return Collections.emptySet();
} }
Set<String> cleaned = new LinkedHashSet<>(names.size()); Set<String> cleaned = new LinkedHashSet<>(names);
for (String name : names) {
cleaned.add(name);
}
return Collections.unmodifiableSet(cleaned); return Collections.unmodifiableSet(cleaned);
} }
......
...@@ -109,10 +109,7 @@ class SpringBootMockMvcBuilderCustomizerTests { ...@@ -109,10 +109,7 @@ class SpringBootMockMvcBuilderCustomizerTests {
@Override @Override
public void write(List<String> lines) { public void write(List<String> lines) {
List<String> written = new ArrayList<>(); List<String> written = new ArrayList<>(lines);
for (String line : lines) {
written.add(line);
}
synchronized (this.monitor) { synchronized (this.monitor) {
this.allWritten.add(written); this.allWritten.add(written);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment