Puoi usare Collections.shuffle(List<?>) per mescolare: https://docs.oracle.com/javase/7/doc...ava.util.List)
Per la generazione del range puoi utilizzare IntStream.rangeClosed(int,int): https://docs.oracle.com/javase/8/doc...losed-int-int-
Un esempio in codice.
codice:import java.util.stream.IntStream; import java.util.stream.Collectors; import java.util.List; import java.util.Collections; class Ideone { public static void main (String[] args) throws java.lang.Exception { for(int e:shuffledRange(15)) { System.out.println(e); } } public static List<Integer> shuffledRange(int n) { List<Integer> lst = IntStream.rangeClosed(1, n).boxed().collect(Collectors.toList()); Collections.shuffle(lst); return lst; } }