@Test
public void testRecognizeComment() {

	Collection<AbstractBlock> blocks = new ArrayList<> ();
	String[] validLines = {
			"# ok",
			"#",
			"     # woo ",
			"  ###############"
	};
	// Without ignoring comments
	for( String line : validLines ) {
		blocks.clear();
		FileDefinitionParser parser = new FileDefinitionParser( null, false );
		int code = parser.recognizeComment( line, blocks );
		Assert.assertEquals( "Expected a YES code for '" + line + "'", FileDefinitionParser.P_CODE_YES, code );
		Assert.assertEquals( "No parsing error was expected for '" + line + "'", 0, parser.getFileRelations().getParsingErrors().size());
		Assert.assertEquals( "Expected ONE block to be registered for '" + line + "'", 1, blocks.size());
		Assert.assertEquals( "Expected ONE comment block for '" + line + "'",
				AbstractBlock.COMMENT,
				blocks.iterator().next().getInstructionType());
	}
	// Ignoring comments
	for( String line : validLines ) {
		blocks.clear();
		FileDefinitionParser parser = new FileDefinitionParser( null, true );
		int code = parser.recognizeComment( line, blocks );
		Assert.assertEquals( "Expected a YES code for '" + line + "'", FileDefinitionParser.P_CODE_YES, code );
		Assert.assertEquals( "No parsing error was expected for '" + line + "'", 0, parser.getFileRelations().getParsingErrors().size());
		Assert.assertEquals( "Expected ZERO block to be registered for '" + line + "'", 0, blocks.size());
	}
	// Testing invalid comments
	String[] invalidLines = {
			"",
			"   	",
			"something",
			"something # with a comment after"
	};
	for( String line : invalidLines ) {
		blocks.clear();
		FileDefinitionParser parser = new FileDefinitionParser( null, true );
		int code = parser.recognizeComment( line, blocks );
		Assert.assertEquals( "Expected a NO code for '" + line + "'", FileDefinitionParser.P_CODE_NO, code );
		Assert.assertEquals( "No parsing error was expected for '" + line + "'", 0, parser.getFileRelations().getParsingErrors().size());
		Assert.assertEquals( "Expected ZERO block to be registered for '" + line + "'", 0, blocks.size());
	}
}