How do I prevent cars from appearing on top of each other in the simple 2D Car game scenario using the getIntersectingObjects(). I tried "removeObjects()" but it keeps throwing an exception


if(getWorld()==null) return;
getWorld().removeObjects(getIntersectingObjects(Car.class));
getWorld().removeObjects(getIntersectingObjects(Car.class));