LoremIpsum { public String generateParagraphsPlainText(int quantity, boolean startWithLorem) { return generateMarkupParagraphs("", "", LINE_SEPARATOR + LINE_SEPARATOR, quantity, startWithLorem); } 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 testGenerateLoreIpsumPlainText() { LOG.debug("Generate new Lore Ipsum as plain text: "); LoremIpsum ipsum = new LoremIpsum(); String output = ipsum.generateParagraphsPlainText(2048, true); LOG.debug(output); LOG.debug(""); }
@Test public void testGenerateLoreIpsumPlainTextFormatted() { LOG.debug("Generate new Lore Ipsum as plain text with 60 columns: "); LoremIpsum ipsum = new LoremIpsum(); String output = ipsum.generateParagraphsPlainText(256, 60, false); LOG.debug(output); LOG.debug(""); }
@Test public void testGenerateLoreIpsumPlainTextWriter() throws IOException { LOG.debug("Generate new Lore Ipsum as plain text with PrintWriter: "); LoremIpsum ipsum = new LoremIpsum(); StringWriter writer = new StringWriter(); ipsum.generateParagraphsPlainText(writer, 2048, true); LOG.debug(writer.toString()); LOG.debug("End Test."); }
@Test public void testGenerateLoreIpsumPlainTextFormattedWriter() throws IOException { LOG.debug("Generate new Lore Ipsum as plain text with 60 columns with PrintWriter: "); LoremIpsum ipsum = new LoremIpsum(); StringWriter writer = new StringWriter(); ipsum.generateParagraphsPlainText(writer, 256, 60, false); LOG.debug(writer.toString()); LOG.debug("End Test."); }
@Test public void testGenerateLoreIpsumGerman() throws Exception { LOG.debug("Generate new Lore Ipsum Ferry Tale: "); InputStream is = this.getClass().getResourceAsStream("/Apache-License-2.0.txt"); final char[] buffer = new char[0x10000]; StringBuilder sample = new StringBuilder(); Reader in = new InputStreamReader(is, "ISO-8859-1"); int read; do { read = in.read(buffer, 0, buffer.length); if (read > 0) { sample.append(buffer, 0, read); } } while (read >= 0); LoremIpsum ipsum = new LoremIpsum(sample.toString()); String output = ipsum.generateParagraphsPlainText(4096, 80, false); LOG.debug(output); LOG.debug("End Test."); }