import java.util.IntStream; // for java 8 and 8+ IntStream.range(start, end).map(x -> arr[x]).toArray();