I have an array of java.awt.Rectangle
s. For those who are not familiar with this class, the important piece of information is that they provid
(this is too long for a comment)
A quick drawing does NOT show that A intersects B: A has an height of 4 while B start at an Y position of 5, how could they intersect!?
You can verify it with the following that prints out 'false':
System.out.println( new Rectangle(0, 0, 2, 4).intersects( new Rectangle(1, 5, 4, 2) ) );
Then your method signature are incomplete so is your code example.
If you clarify a bit your problem and give a working, correct, example, then I've got a very nice solution for you.
You cannot remove an object from a list your iterating through, iterator object or not, you will need to find another way