### Question:
CopyrightHeader { public void writeTo(@Nonnull Writer writer) throws IOException { BufferedWriter bw = new BufferedWriter(writer); if (commentIntro != null) { bw.write(commentIntro); bw.write('\n'); } int textWidth = lineWidth; if (commentLineStart != null) { textWidth -= commentLineStart.length(); } if (commentLineEnd != null) { textWidth -= commentLineEnd.length(); } String[] lines = getLicenseTextTemplate().split("\n"); for (String line : lines) { String localLine = line; while (true) { if (localLine.length() < textWidth) { writeLine(bw, localLine, textWidth); break; } else { int lastSpaceIndex = localLine.lastIndexOf(' ', textWidth); writeLine(bw, localLine.substring(0, lastSpaceIndex), textWidth); localLine = localLine.substring(lastSpaceIndex + 1); } } } if (commentOutro != null) { bw.write(commentOutro); bw.write('\n'); } bw.flush(); } CopyrightHeader(
            int lineWidth,
            @Nullable String commentIntro,
            @Nullable String commentOutro,
            @Nullable String commentLineStart,
            @Nullable String commentLineEnd); void writeTo(@Nonnull Writer writer); boolean isLicenseText(@Nonnull CharSequence text);  }### Answer:
@Test public void testWriteTo() throws Exception { CopyrightHeader header = new CopyrightHeader(80, null, null, null, null); StringWriter writer = new StringWriter(); header.writeTo(writer); String[] lines = writer.toString().split("\n"); for (String line : lines) { if (line.length() > 80) { fail(); } } }