public static <T> List<T> randomSelect_imperative(List<T> list, int n) {
        List<T> result = new ArrayList<>();

        Random random = new Random();
        List<T> remaining = list;
        while (result.size() < n) {
            Object[] objects = P20.removeAt0(remaining, random.nextInt(remaining.size()));
            remaining = (List<T>) objects[0];
            T t = (T) objects[1];
            result.add(t);
        }
        return result;
    }
(**) Extract a given number of randomly selected elements from a list
java8/src/main/java/com/shekhargulati/ninetynine_problems/_01_lists/P23.java