private List<String> assertNotBlankAndTrim(List<String> list,String displayName){
  List<String> trimmed=null;
  if (list != null) {
    for (    String string : list) {
      Assert.hasText(string,displayName + " must not be blank");
    }
    trimmed=new ArrayList<>();
    for (    String string : list) {
      trimmed.add(string.trim());
    }
  }
  return trimmed;
}

private List < String > assertNotBlankAndTrim ( List < String > list , String displayName ) { List < String > trimmed = null ; if ( list != null ) { for ( String string : list ) { Assert . hasText ( string , displayName + " must not be blank" ) ; } trimmed = new ArrayList < > ( ) ; for ( String string : list ) { trimmed . add ( string . trim ( ) ) ; } } return trimmed ; }
asserts that the given list of string contains no blank string and returns a copy of the list with all the values trimmed . if the given list is null , a null is returned .
