@Test public void testWrap_StringInt() { assertNull(Wrap.wrap(null, 20)); assertNull(Wrap.wrap(null, -1)); assertEquals("", Wrap.wrap("", 20)); assertEquals("", Wrap.wrap("", -1)); final String systemNewLine = System.lineSeparator(); String input = "Here is one line of text that is going to be wrapped after 20 columns."; String expected = "Here is one line of" + systemNewLine + "text that is going" + systemNewLine + "to be wrapped after" + systemNewLine + "20 columns."; assertEquals(expected, Wrap.wrap(input, 20)); input = "Click here to jump to the commons website - https: expected = "Click here to jump" + systemNewLine + "to the commons" + systemNewLine + "website -" + systemNewLine + "https: assertEquals(expected, Wrap.wrap(input, 20)); input = "Click here, https: expected = "Click here," + systemNewLine + "https: + "to jump to the" + systemNewLine + "commons website"; assertEquals(expected, Wrap.wrap(input, 20)); input = "word1 word2 word3"; expected = "word1 " + systemNewLine + "word2 " + systemNewLine + "word3"; assertEquals(expected, Wrap.wrap(input, 7)); }
private Wrap() { }
Wrap { private Wrap() { } }
Wrap { private Wrap() { } private  Wrap(); }
Wrap { private Wrap() { } private  Wrap(); static int length(final CharSequence cs); static boolean isBlank(final CharSequence cs); static String wrap(final String str, final int wrapLength); static String wrap(final String str, final int wrapLength, final String newLineStr, final boolean wrapLongWords); static String wrap(final String str, int wrapLength, String newLineStr, final boolean wrapLongWords, String wrapOn); }
Wrap { private Wrap() { } private  Wrap(); static int length(final CharSequence cs); static boolean isBlank(final CharSequence cs); static String wrap(final String str, final int wrapLength); static String wrap(final String str, final int wrapLength, final String newLineStr, final boolean wrapLongWords); static String wrap(final String str, int wrapLength, String newLineStr, final boolean wrapLongWords, String wrapOn);  }