Buggy code:
public class BaseWicketTester extends MockWebApplication { private static final Logger log = LoggerFactory . getLogger ( BaseWicketTester . class ) ; private static final class TestPageSource implements ITestPageSource { private final Page page ; private static final long serialVersionUID = 1L ; private TestPageSource ( Page page ) { } public Page getTestPage ( ) { } } public static class DummyWebApplication extends WebApplication { public Class getHomePage ( ) { } protected void outputDevelopmentModeWarning ( ) { } } public BaseWicketTester ( ) { } public BaseWicketTester ( final Class homePage ) { } public BaseWicketTester ( final WebApplication application ) { } public BaseWicketTester ( final WebApplication application , final String path ) { } public final Page startPage ( final ITestPageSource testPageSource ) { } public void executeListener ( Component component ) { } public void executeBehavior ( final AbstractAjaxBehavior behavior ) { } public final Page startPage ( final Page page ) { } public final Page startPage ( Class pageClass ) { } public FormTester newFormTester ( String path ) { } public FormTester newFormTester ( String path , boolean fillBlankString ) { } public final Panel startPanel ( final TestPanelSource testPanelSource ) { } public final Panel startPanel ( final Class panelClass ) { } public void startComponent ( Component component ) { } private RuntimeException convertoUnexpect ( Exception e ) { } public Component getComponentFromLastRenderedPage ( String path ) { } public Result hasLabel ( String path , String expectedLabelText ) { } public Result isPageLink ( String path , Class expectedPageClass ) { } public Result isComponent ( String path , Class expectedComponentClass ) { } public Result isVisible ( String path ) { } public Result isInvisible ( String path ) { } public Result ifContains ( String pattern ) { } public void assertListView ( String path , List expectedList ) { } public void clickLink ( String path ) { } public void clickLink ( String path , boolean isAjax ) { } public void submitForm ( String path ) { } public void setParameterForNextRequest ( String componentPath , Object value ) { } public Result isRenderedPage ( Class expectedRenderedPageClass ) { } public void assertResultPage ( final Class pageClass , final String filename ) throws Exception { } public Result isResultPage ( final String expectedDocument ) throws Exception { } public Result hasNoErrorMessage ( ) { } public Result hasNoInfoMessage ( ) { } public List getMessages ( final int level ) { } public void dumpPage ( ) { } public void debugComponentTrees ( ) { } public void debugComponentTrees ( String filter ) { } public Result isComponentOnAjaxResponse ( Component component ) { String failMessage = "A<seq2seq4repair_space>component<seq2seq4repair_space>which<seq2seq4repair_space>is<seq2seq4repair_space>null<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>AJAX<seq2seq4repair_space>response" ; notNull ( failMessage , component ) ; String ajaxResponse = getServletResponse ( ) . getDocument ( ) ; failMessage = "The<seq2seq4repair_space>Previous<seq2seq4repair_space>response<seq2seq4repair_space>was<seq2seq4repair_space>not<seq2seq4repair_space>an<seq2seq4repair_space>AJAX<seq2seq4repair_space>response.<seq2seq4repair_space>" + "You<seq2seq4repair_space>need<seq2seq4repair_space>to<seq2seq4repair_space>execute<seq2seq4repair_space>an<seq2seq4repair_space>AJAX<seq2seq4repair_space>event,<seq2seq4repair_space>using<seq2seq4repair_space>clickLink,<seq2seq4repair_space>before<seq2seq4repair_space>using<seq2seq4repair_space>this<seq2seq4repair_space>assert" ; boolean isAjaxResponse = ajaxResponse . startsWith ( "<?xml<seq2seq4repair_space>version=\"1.0\"<seq2seq4repair_space>encoding=\"UTF-8\"?><ajax-response>" ) ; Result result = isTrue ( failMessage , isAjaxResponse ) ; if ( result . wasFailed ( ) ) { return result ; } String markupId = component . getMarkupId ( ) ; failMessage = "The<seq2seq4repair_space>component<seq2seq4repair_space>doesn't<seq2seq4repair_space>have<seq2seq4repair_space>a<seq2seq4repair_space>markup<seq2seq4repair_space>id,<seq2seq4repair_space>" + "which<seq2seq4repair_space>means<seq2seq4repair_space>that<seq2seq4repair_space>it<seq2seq4repair_space>can't<seq2seq4repair_space>have<seq2seq4repair_space>been<seq2seq4repair_space>added<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>AJAX<seq2seq4repair_space>response" ; result = isTrue ( failMessage , ( ! ( Strings . isEmpty ( markupId ) ) ) ) ; if ( result . wasFailed ( ) ) { return result ; } <START_BUG> boolean isComponentInAjaxResponse = ajaxResponse . matches ( ( ( ".*<component<seq2seq4repair_space>id=\"" + markupId ) + "\"<seq2seq4repair_space>?>.*" ) ) ; <END_BUG> failMessage = "Component<seq2seq4repair_space>wasn't<seq2seq4repair_space>found<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>AJAX<seq2seq4repair_space>response" ; return isTrue ( failMessage , isComponentInAjaxResponse ) ; } public void executeAjaxEvent ( String componentPath , String event ) { } public void executeAjaxEvent ( Component component , String event ) { } public TagTester getTagByWicketId ( String wicketId ) { } public TagTester getTagById ( String id ) { } private void submitAjaxFormSubmitBehavior ( AjaxFormSubmitBehavior behavior ) { } public String getContentTypeFromResponseHeader ( ) { } public int getContentLengthFromResponseHeader ( ) { } public String getLastModifiedFromResponseHeader ( ) { } public String getContentDispositionFromResponseHeader ( ) { } private Result isTrue ( String message , boolean condition ) { } private Result isEqual ( Object expected , Object actual ) { } private void notNull ( String message , Object object ) { } private Result isNull ( String message , Object object ) { } private void fail ( String message ) { } }

Fix:
boolean isComponentInAjaxResponse = ajaxResponse . matches ( ( ( "(?s).*<component<seq2seq4repair_space>id=\"" + markupId ) + "\"<seq2seq4repair_space>?>.*" ) ) ;