private int removeTagByName ( List < TagReference > tags , String tagName ) { List < TagReference > removeTags = new ArrayList <> ( ) ; for ( TagReference tag : tags ) { if ( Objects . equals ( tagName , tag . getName ( ) ) ) { removeTags . add ( tag ) ; } } tags . removeAll ( removeTags ) ; return removeTags . size ( ) ; }
Removes all the tags with the given name