TextUtil { static String formatJavaDocBox(String text) { requireNonNull(text); return formatTextBox(text, JAVA_DOC_WIDTH, JAVADOC_WORDS, JAVA_DOC_SINGLE_LINE_WORDS); } private  TextUtil(); static String alignCenter(String substring, int totalWidth); static String alignLeft(String substring, int totalWidth); static String alignRight(String substring, int totalWidth);  }
@Test void testFormatJavaDocBox() { String text = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789."; String eRes = "123456789 123456789 123456789 123456789 123456789 123456789 123456789\n123456789 123456789 123456789 123456789 123456789 123456789."; String result = TextUtil.formatJavaDocBox(text); assertEquals(eRes, result); }