Java tutorial
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { public static <T> List<T> createRangeData(Class<T> clazz, int value) { List<T> list = new ArrayList<>(); for (int i = 0; i < value; i++) { try { list.add(clazz.newInstance()); } catch (Exception e) { e.printStackTrace(); } } return list; } }