Source:
private static void validatePropertySectionPropertyTokens(String fileName, String sectionName, AbstractCheck check, List<Node> columns) { assertEquals("tokens to check", columns.get(1).getTextContent(), fileName + " section '" + sectionName + "' should have the basic token description"); final String acceptableTokenText = columns.get(2).getTextContent().trim(); String expectedAcceptableTokenText = "subset of tokens " + CheckUtil.getTokenText(check.getAcceptableTokens(), check.getRequiredTokens()); if (isAllTokensAcceptable(check)) { expectedAcceptableTokenText = "set of any supported tokens"; } assertEquals(expectedAcceptableTokenText, acceptableTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the acceptable tokens"); assertFalse(isInvalidTokenPunctuation(acceptableTokenText), fileName + "'s acceptable token section: " + sectionName + "should have ',' & '.' at beginning of the next corresponding lines."); final String defaultTokenText = columns.get(3).getTextContent().trim(); final String expectedDefaultTokenText = CheckUtil.getTokenText(check.getDefaultTokens(), check.getRequiredTokens()); if (expectedDefaultTokenText.isEmpty()) { assertEquals("empty", defaultTokenText, "Empty tokens should have 'empty' string in xdoc"); } else { assertEquals(expectedDefaultTokenText, defaultTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the default tokens"); assertFalse(isInvalidTokenPunctuation(defaultTokenText), fileName + "'s default token section: " + sectionName + "should have ',' & '.' at beginning of the next corresponding lines."); } }

Target:
private static void validatePropertySectionPropertyTokens(String fileName, String sectionName, AbstractCheck check, List<Node> columns) { assertEquals("tokens to check", columns.get(1).getTextContent(), fileName + " section '" + sectionName + "' should have the basic token description"); final String acceptableTokenText = columns.get(2).getTextContent().trim(); String expectedAcceptableTokenText = "subset of tokens " + CheckUtil.getTokenText(check.getAcceptableTokens(), check.getRequiredTokens()); if (isAllTokensAcceptable(check)) { expectedAcceptableTokenText = "set of any supported tokens"; } assertEquals(expectedAcceptableTokenText, acceptableTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the acceptable tokens"); assertFalse(isInvalidTokenPunctuation(acceptableTokenText), fileName + "'s acceptable token section: " + sectionName + "should have ',' & '.' at beginning of the next corresponding lines."); final String defaultTokenText = columns.get(3).getTextContent().trim(); final String expectedDefaultTokenText = CheckUtil.getTokenText(check.getDefaultTokens(), check.getRequiredTokens()); if (expectedDefaultTokenText.isEmpty()) { assertEquals("empty", defaultTokenText, "Empty tokens should have 'empty' string in xdoc"); } else { assertEquals(expectedDefaultTokenText, defaultTokenText .replaceAll("\\s+", " ") .replaceAll("\\s,", ",") .replaceAll("\\s\\.", "."), fileName + " section '" + sectionName + "' should have all the default tokens"); assertFalse(isInvalidTokenPunctuation(defaultTokenText), fileName + "'s default token section: " + sectionName + "should have ',' or '.' at beginning of the next corresponding lines."); } }