question: protected boolean stringContainsLine ( final String stringToSearch , final String stringPattern ) { assert ( stringToSearch != null ) ; assert ( stringPattern != null ) ; Pattern pattern = Pattern . compile ( "^\\s*" + stringPattern + "\\s*$" , Pattern . MULTILINE ) ; Matcher matcher = pattern . matcher ( stringToSearch ) ; return matcher . find ( ) ; }
target:  Determines if a string contains a trimmed line that matches the pattern. So, any single line whose leading and trailing spaces have been removed which contains a string that exactly matches the given pattern will be considered a match.