You can use syntax with labels and int counters.
My example with String class instead of Ball:
CopyOnWriteArrayList<String> bList = new CopyOnWriteArrayList<String>();
bList.add("1");
bList.add("2");
bList.add("3");
bList.add("4");
bList.add("5");
int i = 0;
for (String s : bList) {
System.out.println("outer: " + s);
int j = 0;
l: for (String s2 : bList) {
while(j < i) {
j++;
continue l;
}
System.out.println("inner: " + s2);
}
i++;
}
Output will be:
outer: 1
inner: 1
inner: 2
inner: 3
inner: 4
inner: 5
outer: 2
inner: 2
inner: 3
inner: 4
inner: 5
outer: 3
inner: 3
inner: 4
inner: 5
outer: 4
inner: 4
inner: 5
outer: 5
inner: 5
You can't modify collection in such conditions. I mean you can't remove any element from the collection while iterating through it.
I would like to suggest you to put all the collisions in some data structure, like ArrayList and remove elements AFTER iteration(loops).