diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java index e0d745756b..6ddd231027 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxFlattenIterableTest.java @@ -29,7 +29,6 @@ import java.util.stream.IntStream; import org.assertj.core.api.Assertions; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.reactivestreams.Subscription; import reactor.core.CoreSubscriber; @@ -148,13 +147,9 @@ public void useIterableOncePerSubscriber() { AtomicInteger calls = new AtomicInteger(); Flux.range(1, 5) - .concatMapIterable(v -> new Iterable() { - @NotNull - @Override - public Iterator iterator() { - calls.incrementAndGet(); - return Arrays.asList("hello " + v).iterator(); - } + .concatMapIterable(v -> (Iterable) () -> { + calls.incrementAndGet(); + return Arrays.asList("hello " + v).iterator(); }) .as(StepVerifier::create) .expectNext("hello 1", "hello 2", "hello 3", "hello 4", "hello 5") diff --git a/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java b/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java index 38cd4fbd64..412d0b5e87 100644 --- a/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java +++ b/reactor-core/src/test/java/reactor/core/publisher/FluxIterableTest.java @@ -25,7 +25,6 @@ import org.assertj.core.api.Assertions; import org.assertj.core.api.InstanceOfAssertFactories; -import org.jetbrains.annotations.NotNull; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; import org.mockito.Mockito; @@ -54,13 +53,9 @@ public class FluxIterableTest { //https://github.com/reactor/reactor-core/issues/3295 public void useIterableOncePerSubscriber() { AtomicInteger calls = new AtomicInteger(); - Iterable strings = new Iterable() { - @NotNull - @Override - public Iterator iterator() { - calls.incrementAndGet(); - return Arrays.asList("hello").iterator(); - } + Iterable strings = () -> { + calls.incrementAndGet(); + return Arrays.asList("hello").iterator(); }; StepVerifier.create(Flux.fromIterable(strings)) .expectNext("hello")