private void validateDepNameUniqueness ( final List < TriggerDependencyBean > dependencies ) { final Set < String > seen = new HashSet <> ( ) ; for ( final TriggerDependencyBean dep : dependencies ) { // set.add() returns false when there exists duplicate Preconditions . checkArgument ( seen . add ( dep . getName ( ) ) , String . format ( "duplicate dependency" + ".name %s found, dependency.name should be unique" , dep . getName ( ) ) ) ; } }
check uniqueness of dependency . name