@Test
	public void testRemove() {
		List<Integer> list1 = new ArrayList<Integer>(Arrays.asList(1, 2, 3, 4, 5));
		List<String> list2 = new ArrayList<String>(Arrays.asList("1", "2", "3", "4", "5"));
		for (int i=0; i<list1.size(); i++) {
			System.out.println("size:" + list1.size() + " " + i + "->" + list1.get(i));
			if (list1.get(i) == 2 || list1.get(i) == 5) {
				list1.remove(i);
				list2.remove(i);
			}
		}
		System.out.println(list1);
		System.out.println(list2);
		
		list2 = new ArrayList<String>(Arrays.asList("1", "2", "3", "4", "5"));
		list2 = new CopyOnWriteArrayList<>(list2);
		for (String string : list2) {
			if ("2".equals(string)) {
				list2.remove(string);
			}
		}
		System.out.println(list2);
	}