question: public void addFilter ( Filter filter ) { int size = filters . size ( ) ; if ( size == 0 || filter . type == FilterType . SHOW || filters . get ( size - 1 ) . type != FilterType . SHOW ) { filters . add ( filter ) ; } else { for ( int i = 0 ; i < size ; i ++ ) { if ( filters . get ( i ) . type == FilterType . SHOW ) { filters . add ( i , filter ) ; break ; } } } }
target:  Adds the given filter to the list of filters. Maintains the invariant that all 'show' filters are listed after other types of filters.