if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP || whitespace == IdentValue.PRE) {
if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP) {
    static String collapseWhitespace(IdentValue whitespace, String text, boolean collapseLeading) {        // do step 1        if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP || whitespace == IdentValue.PRE) {            text = linefeed_space_collapse.matcher(text).replaceAll(EOL);        }        // do step 2        // pull out pre's for breaking        // OK: any spaces in a pre or pre-wrap are considered to be non-breaking        // resolve that later, the space-sequence may only be broken at the end!        // do step 3        // convert line feeds to spaces        if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP) {            text = linefeed_to_space.matcher(text).replaceAll(SPACE);        }        // do step 4        if (whitespace == IdentValue.NORMAL || whitespace == IdentValue.NOWRAP || whitespace == IdentValue.PRE) {            text = tab_to_space.matcher(text).replaceAll(SPACE);            text = space_collapse.matcher(text).replaceAll(SPACE);            // collapse first space against prev inline            if (text.startsWith(SPACE) &&                    collapseLeading) {                text = text.substring(1, text.length());            }        }        return text;    }