question: public static void addOrUpdateKeywordSet ( List < KeywordSet > keywords , String keyword , String thesaurus ) { if ( ! Strings . isNullOrEmpty ( keyword ) && ! Strings . isNullOrEmpty ( thesaurus ) ) { String capped = StringUtils . capitalize ( keyword . toLowerCase ( ) ) ; boolean found = false ; for ( KeywordSet ks : keywords ) { String keywordThesaurus = ks . getKeywordThesaurus ( ) ; if ( ! Strings . isNullOrEmpty ( keywordThesaurus ) && keywordThesaurus . equalsIgnoreCase ( thesaurus ) ) { String keywordString = ks . getKeywordsString ( ) ; if ( Strings . isNullOrEmpty ( keywordString ) ) { ks . setKeywordsString ( capped ) ; } found = true ; break ; } } if ( ! found ) { KeywordSet ks = new KeywordSet ( ) ; ks . setKeywordThesaurus ( thesaurus ) ; ks . setKeywordsString ( capped ) ; keywords . add ( ks ) ; } } }
target:  Add or update KeywordSet identified by thesaurus name. If the KeywordSet is found and already contains a a non empty and not null keywordString, its value is not overwritten.