How can I rewrite my code without using concurrent collections?
public static void main(String[] args) {
ArrayList<Integer> source = new ArrayList<>();
for(int i = 0; i < 5; i++) {
source.add(i);
}
List<Integer> synchList = Collections.synchronizedList(new ArrayList<>());
Runnable runnable = () -> {synchList.addAll(source);};
}