List<Integer> keys = new ArrayList<Integer>();
for (int i = 0; i < 5; i++) {
keys.add(i);
keys.add(i);
}
//List转化为数组
Integer[] arrays = (keys.toArray(new Integer[0]));
for(Integer a : arrays){
System.out.println("-array-"+a);
}
//数组转化为List
List<Integer> list = Arrays.asList(arrays);
for(Integer l : list){
System.out.println("-list-"+l);
}