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();
}

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 ( ) ; }
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 .
