LoremIpsum { static String[] splitParagraphs(String text) { return filterNotEmptyOrWhiteSpace(text.split("\n")).toArray(new String[0]); } LoremIpsum();  LoremIpsum(String sample, String dictionary);  LoremIpsum(String sample, String[] newDictionary);  LoremIpsum(String sample); String generateParagraph(boolean optStartWithLorem); String generateSentence(boolean optStartWithLorem); String getSample(); void setSample(String sample); String getDictionary(); void setDictionary(String dictionary); static double mean(int[] values); static double mean(double[] values); static double variance(double[] values); static double sigma(int[] values); static double sigma(double[] values); static int sum(int[] values); static double sum(double[] values); static boolean contains(String[] array, String val); String generateParagraphsHtml(int quantity, boolean startWithLorem); void generateParagraphsHtml(Appendable writer, int quantity, boolean startWithLorem); String generateOneParagraphHtml(int quantity, boolean startWithLorem); String generateParagraphsFullHtml(int quantity, boolean startWithLorem); void generateParagraphsFullHtml(Appendable writer, int quantity, boolean startWithLorem); String generateParagraphsPlainText(int quantity, boolean startWithLorem); void generateParagraphsPlainText(Appendable writer, int quantity, boolean startWithLorem); String generateParagraphsPlainText(int quantity, int maxCols, boolean startWithLorem); void generateParagraphsPlainText(Appendable writer, int quantity, int maxCols, boolean startWithLorem);  }
@Test public void test_split_paragraphs_empty() { String[] paragraphs = {}; assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("")); }
@Test public void test_split_paragraphs_trailing() { String[] paragraphs = { "Hello", "Hi" }; assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("Hello\n\nHi")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("Hello\n\nHi\n")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("Hello\n\nHi\n\n")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("Hello\n\nHi\n\n\n")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("Hello\n\nHi\n\n\n\n\n\n")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("\nHello\n\nHi")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("\n\nHello\n\nHi")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("\n\n\nHello\n\nHi")); assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs("\n\n\n\n\n\nHello\n\nHi")); }
@Test public void test_split_paragraphs() { String[] paragraphs = { "One two three four five six. Seven eight nine ten eleven twelve.", "Thirteen fourteen fifteen sixteen. Seventeen eighteen nineteen twenty." }; assertArrayEquals(paragraphs, LoremIpsum.splitParagraphs(sample)); }