question: private void addAttributesToTag ( TagNode tag , Map < String , String > attributes ) { if ( attributes != null ) { Map < String , String > tagAttributes = tag . getAttributes ( ) ; for ( Map . Entry < String , String > currEntry : attributes . entrySet ( ) ) { String attName = currEntry . getKey ( ) ; if ( ! tagAttributes . containsKey ( attName ) ) { String attValue = currEntry . getValue ( ) ; tag . addAttribute ( attName , attValue ) ; } } } }
target:  Add attributes from specified map to the specified tag. If some attribute already exist it is preserved.