Java Code Examples for

The following are Jave code examples for showing how to use toString() of the class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File:   View Source Code Vote up 7 votes
String getExpected(List<String> lines) {
    boolean start = false;
    StringWriter sw = new StringWriter();
    PrintWriter out = new PrintWriter(sw);
    for (String line : lines) {
        if (!start) {
            start = line.startsWith(MARKER_START);
        if (line.startsWith(MARKER_END)) {
            return sw.toString();
    return out.toString() + "Warning: html comment end not found";