### Question:
SnippetReader { protected static boolean isDemarcator( String snippetId, String what, String line ) { String snippetRegExp = "(^|\\W)(?i:SNIPPET)($|\\W)"; String snippetIdRegExp = "(^|\\W)" + snippetId + "($|\\W)"; String whatRegExp = "(^|\\W)(?i:" + what + ")($|\\W)"; return Pattern.compile( snippetRegExp ).matcher( line ).find() && Pattern.compile( whatRegExp ).matcher( line ).find() && Pattern.compile( snippetIdRegExp ).matcher( line ).find(); } SnippetReader( URL src, String encoding );  SnippetReader( URL src ); StringBuffer readSnippet( String snippetId );  }### Answer:
@Test public void testIsDemarcator() { String snippetId = "first"; String what = "START"; assertTrue( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START first" ) ); assertTrue( SnippetReader.isDemarcator( snippetId, what, "SNIPPET start first" ) ); assertTrue( SnippetReader.isDemarcator( snippetId, what, "snippet START first" ) ); assertTrue( SnippetReader.isDemarcator( snippetId, what, "snippet start first" ) ); assertTrue( SnippetReader.isDemarcator( snippetId, what, "<!-- START SNIPPET: first -->" ) ); assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START First" ) ); assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START FIRST" ) ); assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START first_id" ) ); assertFalse( SnippetReader.isDemarcator( snippetId, what, "SNIPPET START id_first" ) ); }