Code example for CopyOnWriteArrayList

Methods: add, contains

0
//		this.handlers.remove(handler); 
//	} 
	 
	public static <TEventHandler> boolean addEventHandler( 
			CopyOnWriteArrayList<TEventHandler> eventHandlers, TEventHandler eventHandler) {
		if (eventHandler != null && eventHandlers != null && !eventHandlers.contains(eventHandler)) {
			return eventHandlers.add(eventHandler);
		} 
		return false; 
	} 
	 
	public static <TEventHandler> boolean removeEventHandler( 
			CopyOnWriteArrayList<TEventHandler> eventHandlers, TEventHandler eventHandler) {
		if (eventHandler != null && eventHandlers != null) {
			return eventHandlers.remove(eventHandler);
		} 
		return false; 
	} 
}