public RectangularObstacle whichObstacle(int x, int y) {
		if (obstacles != null && !obstacles.isEmpty()) {
			RectangularObstacle r2d = null;
			synchronized (obstacles.getSynchronizationLock()) {
				for (Iterator it = obstacles.iterator(); it.hasNext();) {
					r2d = (RectangularObstacle) it.next();
					if (r2d.contains(x, y))
						return r2d;
				}
			}
		}
		return null;
	}