public static < T > boolean removeFromList ( T listener , List < ? extends ListenerRegistration < T > > list ) { checkNotNull ( listener ) ; ListenerRegistration < T > item = null ; for ( ListenerRegistration < T > registration : list ) { if ( registration . listener == listener ) { item = registration ; break ; } } return item != null && list . remove ( item ) ; }
Returns true if the listener was removed else false .