@Test public void appendIfNotExists_A$StringBuilder$String$String_StringIsEmpty() throws Exception { LineBreakProvider lineBreakProvider = new LineBreakProvider(config, currentLineBreak); SourceCodeAppender target = new SourceCodeAppender(lineBreakProvider, indentationProvider); StringBuilder buf = new StringBuilder(); String src = ""; String importLine = ""; target.appendIfNotExists(buf, src, importLine); }
void appendIfNotExists(StringBuilder buf, String src, String importLine) { Assertion.on("buf").mustNotBeNull(buf); Assertion.on("src").mustNotBeNull(src); Assertion.on("importLine").mustNotBeNull(importLine); String oneline = src.replaceAll(RegExp.CRLF, StringValue.Space); importLine = importLine.replace(StringValue.CarriageReturn + StringValue.LineFeed, StringValue.Empty); String importLineRegExp = importLine.replaceAll("\\s+", "\\\\s+").replaceAll("\\.", "\\\\.").replaceAll("\\*", "\\\\*"); if (!oneline.matches(RegExp.Anything_ZeroOrMore_Min + importLineRegExp + RegExp.Anything_ZeroOrMore_Min)) { buf.append(importLine); buf.append(StringValue.CarriageReturn); buf.append(StringValue.LineFeed); } }
SourceCodeAppender { void appendIfNotExists(StringBuilder buf, String src, String importLine) { Assertion.on("buf").mustNotBeNull(buf); Assertion.on("src").mustNotBeNull(src); Assertion.on("importLine").mustNotBeNull(importLine); String oneline = src.replaceAll(RegExp.CRLF, StringValue.Space); importLine = importLine.replace(StringValue.CarriageReturn + StringValue.LineFeed, StringValue.Empty); String importLineRegExp = importLine.replaceAll("\\s+", "\\\\s+").replaceAll("\\.", "\\\\.").replaceAll("\\*", "\\\\*"); if (!oneline.matches(RegExp.Anything_ZeroOrMore_Min + importLineRegExp + RegExp.Anything_ZeroOrMore_Min)) { buf.append(importLine); buf.append(StringValue.CarriageReturn); buf.append(StringValue.LineFeed); } } }
SourceCodeAppender { void appendIfNotExists(StringBuilder buf, String src, String importLine) { Assertion.on("buf").mustNotBeNull(buf); Assertion.on("src").mustNotBeNull(src); Assertion.on("importLine").mustNotBeNull(importLine); String oneline = src.replaceAll(RegExp.CRLF, StringValue.Space); importLine = importLine.replace(StringValue.CarriageReturn + StringValue.LineFeed, StringValue.Empty); String importLineRegExp = importLine.replaceAll("\\s+", "\\\\s+").replaceAll("\\.", "\\\\.").replaceAll("\\*", "\\\\*"); if (!oneline.matches(RegExp.Anything_ZeroOrMore_Min + importLineRegExp + RegExp.Anything_ZeroOrMore_Min)) { buf.append(importLine); buf.append(StringValue.CarriageReturn); buf.append(StringValue.LineFeed); } } SourceCodeAppender(LineBreakProvider lineBreakProvider, IndentationProvider indentationProvider); }
SourceCodeAppender { void appendIfNotExists(StringBuilder buf, String src, String importLine) { Assertion.on("buf").mustNotBeNull(buf); Assertion.on("src").mustNotBeNull(src); Assertion.on("importLine").mustNotBeNull(importLine); String oneline = src.replaceAll(RegExp.CRLF, StringValue.Space); importLine = importLine.replace(StringValue.CarriageReturn + StringValue.LineFeed, StringValue.Empty); String importLineRegExp = importLine.replaceAll("\\s+", "\\\\s+").replaceAll("\\.", "\\\\.").replaceAll("\\*", "\\\\*"); if (!oneline.matches(RegExp.Anything_ZeroOrMore_Min + importLineRegExp + RegExp.Anything_ZeroOrMore_Min)) { buf.append(importLine); buf.append(StringValue.CarriageReturn); buf.append(StringValue.LineFeed); } } SourceCodeAppender(LineBreakProvider lineBreakProvider, IndentationProvider indentationProvider);  }
SourceCodeAppender { void appendIfNotExists(StringBuilder buf, String src, String importLine) { Assertion.on("buf").mustNotBeNull(buf); Assertion.on("src").mustNotBeNull(src); Assertion.on("importLine").mustNotBeNull(importLine); String oneline = src.replaceAll(RegExp.CRLF, StringValue.Space); importLine = importLine.replace(StringValue.CarriageReturn + StringValue.LineFeed, StringValue.Empty); String importLineRegExp = importLine.replaceAll("\\s+", "\\\\s+").replaceAll("\\.", "\\\\.").replaceAll("\\*", "\\\\*"); if (!oneline.matches(RegExp.Anything_ZeroOrMore_Min + importLineRegExp + RegExp.Anything_ZeroOrMore_Min)) { buf.append(importLine); buf.append(StringValue.CarriageReturn); buf.append(StringValue.LineFeed); } } SourceCodeAppender(LineBreakProvider lineBreakProvider, IndentationProvider indentationProvider);   }