Code example for ConcurrentModificationException

0
	public void addUpdateListener(UpdateListener listener) { 
		if(handler==null) { 
			throw new IllegalStateException("Service was not started. Cannot add listener."); 
		}		 
		if(handler.getLooper().getThread()!=Thread.currentThread()) { 
			throw new ConcurrentModificationException(); 
		} 
		this.updateListeners.add(listener); 
	} 
	 
	public void removeUpdateListener(UpdateListener listener) { 
		if(handler==null) { 
			throw new IllegalStateException("Service was not started. Cannot add listener."); 
		} 
		if(handler.getLooper().getThread()!=Thread.currentThread()) { 
			throw new ConcurrentModificationException(); 
		} 
		this.updateListeners.remove(listener); 
	} 	  
	 
	private void fireNewDataLoaded() {