I haven't written any Java in years and I wanted to catch up a little, especially on newer features. I started looking at streams and aggregate operations and came up with the following solution to Project Euler #7 (find the 10001st prime).package com.example;import java.util.stream.IntStream;import org.apache.commons.lang3.time.StopWatch;public class Main {    static boolean isPrime(int i) {        int limit = (int)Math.sqrt(i)+1;        return !IntStream.range(2, limit)                .anyMatch(n -> i % n == 0);    }    public static void main(String[] args) {        StopWatch stopWatch = new StopWatch();        int n = 10001;        stopWatch.start();        int nthPrime = IntStream.iterate(2, i -> i+1)                .filter(Main::isPrime)                .skip(n-1)                .findFirst().getAsInt();        stopWatch.stop();        System.out.printf(The %dth prime is %d\n, n, nthPrime);        System.out.printf(Execution time: %.2fs\n, (float)stopWatch.getTime()/1000);    }}Is there any obvious way to speed it up? Am I overcomplicating something? My way of getting an infinite sequence of integers, for example. Any other feedback?
Project Euler #7 using Java streams
java;programming challenge