Files
openide/java/java-tests/testData/inspection/streamApiCallChains/afterMapToPeekPrimitive.java
Tagir Valeevandintellij-monorepo-bot b9a2e79c7c [intention-preview] Draft of automatic preview testing with LightQuickFixTestCase
Use "true+preview" to check preview. By default, checks whether preview is equal to the actual action result.
Alternatively, previewXyz file could be supplied to assert the preview text

GitOrigin-RevId: 24a7a7539466137827200458ced235dd5e2b6d0a
2022-07-21 18:15:25 +00:00

16 lines
393 B
Java

// "Replace with 'peek'" "true-preview"
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.IntStream;
public class Main {
void test() {
AtomicInteger counter = new AtomicInteger();
int[] ints = IntStream.range(0, 100)
.filter(x -> x % 3 == 0)
.peek((x -> counter.incrementAndGet()))
.toArray();
System.out.println(counter.get());
}
}