Skip to content

Commit 8669bcc

Browse files
committed
improve
1 parent 8b38dda commit 8669bcc

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

muzzle/src/test/java/io/opentelemetry/javaagent/tooling/muzzle/HelperReferenceWrapperTest.java

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
import io.opentelemetry.javaagent.tooling.muzzle.references.Flag.ManifestationFlag;
1414
import io.opentelemetry.javaagent.tooling.muzzle.references.Source;
1515
import java.util.HashMap;
16-
import java.util.List;
1716
import java.util.Map;
18-
import java.util.stream.Collectors;
1917
import muzzle.HelperReferenceWrapperTestClasses;
2018
import net.bytebuddy.pool.TypePool;
2119
import org.junit.jupiter.api.BeforeAll;
@@ -73,7 +71,6 @@ void shouldWrapHelperTypes() {
7371
new HelperReferenceWrapper.Factory(typePool, references, helperClassPredicate)
7472
.create(helperClass);
7573

76-
// helperWrapper assertions
7774
assertThat(helperWrapper.isAbstract()).isFalse();
7875

7976
assertThat(helperWrapper.getMethods())
@@ -101,7 +98,7 @@ void shouldWrapHelperTypes() {
10198
.satisfies(
10299
baseHelper -> {
103100
assertThat(baseHelper.isAbstract()).isTrue();
104-
assertThat(baseHelper.getMethods().collect(Collectors.toList()))
101+
assertThat(baseHelper.getMethods())
105102
.hasSize(2)
106103
.satisfies(
107104
method -> {
@@ -144,9 +141,7 @@ void shouldWrapHelperTypes() {
144141
.satisfies(
145142
wrapper -> {
146143
assertThat(wrapper.isAbstract()).isTrue();
147-
List<HelperReferenceWrapper.Method> interface1Methods =
148-
wrapper.getMethods().collect(Collectors.toList());
149-
assertThat(interface1Methods)
144+
assertThat(wrapper.getMethods())
150145
.hasSize(1)
151146
.satisfies(
152147
method -> {
@@ -156,8 +151,7 @@ void shouldWrapHelperTypes() {
156151
},
157152
atIndex(0));
158153
assertThat(wrapper.hasSuperTypes()).isFalse();
159-
assertThat(wrapper.getSuperTypes().collect(Collectors.toList()))
160-
.isEmpty();
154+
assertThat(wrapper.getSuperTypes()).isEmpty();
161155
},
162156
atIndex(1));
163157
},
@@ -166,11 +160,8 @@ void shouldWrapHelperTypes() {
166160
atIndex(0))
167161
.satisfies(
168162
interface2 -> {
169-
// interface2 assertions
170163
assertThat(interface2.isAbstract()).isTrue();
171-
List<HelperReferenceWrapper.Method> interface2Methods =
172-
interface2.getMethods().collect(Collectors.toList());
173-
assertThat(interface2Methods)
164+
assertThat(interface2.getMethods())
174165
.hasSize(1)
175166
.satisfies(
176167
method -> {
@@ -180,7 +171,7 @@ void shouldWrapHelperTypes() {
180171
},
181172
atIndex(0));
182173
assertThat(interface2.hasSuperTypes()).isFalse();
183-
assertThat(interface2.getSuperTypes().collect(Collectors.toList())).isEmpty();
174+
assertThat(interface2.getSuperTypes()).isEmpty();
184175
},
185176
atIndex(1));
186177
}

0 commit comments

Comments
 (0)