|
19 | 19 | import java.util.Iterator;
|
20 | 20 | import java.util.function.Predicate;
|
21 | 21 | import java.util.function.Supplier;
|
22 |
| -import java.util.stream.DoubleStream; |
23 |
| -import java.util.stream.IntStream; |
24 |
| -import java.util.stream.LongStream; |
| 22 | +import java.util.stream.BaseStream; |
25 | 23 | import java.util.stream.Stream;
|
26 | 24 |
|
27 | 25 | import org.junit.jupiter.api.extension.ExtensionContext;
|
@@ -107,15 +105,8 @@ private static Object readField(Field field, Object testInstance) {
|
107 | 105 | Preconditions.notNull(value,
|
108 | 106 | () -> format("The value of field [%s] in class [%s] must not be null", fieldName, declaringClass));
|
109 | 107 |
|
110 |
| - boolean isStream = value instanceof Stream// |
111 |
| - || value instanceof DoubleStream// |
112 |
| - || value instanceof IntStream// |
113 |
| - || value instanceof LongStream; |
114 |
| - |
115 |
| - Preconditions.condition(!isStream, |
116 |
| - () -> format( |
117 |
| - "The value of field [%s] in class [%s] must not be a Stream, IntStream, LongStream, or DoubleStream", |
118 |
| - fieldName, declaringClass)); |
| 108 | + Preconditions.condition(!(value instanceof BaseStream), |
| 109 | + () -> format("The value of field [%s] in class [%s] must not be a stream", fieldName, declaringClass)); |
119 | 110 |
|
120 | 111 | Preconditions.condition(!(value instanceof Iterator),
|
121 | 112 | () -> format("The value of field [%s] in class [%s] must not be an Iterator", fieldName, declaringClass));
|
|
0 commit comments