As of Java-9, there exists [IntStream.html#iterate(seed, hasNext, next)](https://docs.oracle.com/javase/10/docs/api/java/util/stream/IntStream.html#iterate(int,java.util.function.IntPredicate,java.util.function.IntUnaryOperator)) If you are trying to get a comma separated list of speeds, use: String allSpeeds = IntStream.iterate(minKmh, i -> i <= maxKmh, i -> i + step) .mapToObj(Integer::toString) .collect( Collectors.joining( "," ) ); If you just want the integer array of speeds: int[] speeds = IntStream.iterate(minKmh, i -> i <= maxKmh, i -> i + step).toArray(); Or, if you want the array of speeds as Strings: String[] allSpeedsAsArray = IntStream.iterate(minKmh, i -> i <= maxKmh, i -> i + step) .mapToObj(Integer::toString) .toArray();