@Test public void testLang100() { final int size = 5000; final Charset charset = Charset.forName("UTF-8"); final String orig = CommonsLang3RandomStringUtils.random(size); final byte[] bytes = orig.getBytes(charset); final String copy = new String(bytes, charset); for (int i=0; i < orig.length() && i < copy.length(); i++) { final char o = orig.charAt(i); final char c = copy.charAt(i); assertEquals(o, c, "differs at " + i + "(" + Integer.toHexString(new Character(o).hashCode()) + "," + Integer.toHexString(new Character(c).hashCode()) + ")"); } assertEquals(orig.length(), copy.length()); assertEquals(orig, copy); }
public static String random(final int count) { return random(count, false, false); }
CommonsLang3RandomStringUtils { public static String random(final int count) { return random(count, false, false); } }
CommonsLang3RandomStringUtils { public static String random(final int count) { return random(count, false, false); } CommonsLang3RandomStringUtils(); }
CommonsLang3RandomStringUtils { public static String random(final int count) { return random(count, false, false); } CommonsLang3RandomStringUtils(); static String random(final int count); static String randomAscii(final int count); static String randomAlphabetic(final int count); static String randomAlphanumeric(final int count); static String randomNumeric(final int count); static String random(final int count, final boolean letters, final boolean numbers); static String random(final int count, final int start, final int end, final boolean letters, final boolean numbers); static String random(final int count, final int start, final int end, final boolean letters, final boolean numbers, final char... chars); static String random(int count, int start, int end, final boolean letters, final boolean numbers,
                                final char[] chars, final Random random); static String random(final int count, final String chars); static String random(final int count, final char... chars); }
CommonsLang3RandomStringUtils { public static String random(final int count) { return random(count, false, false); } CommonsLang3RandomStringUtils(); static String random(final int count); static String randomAscii(final int count); static String randomAlphabetic(final int count); static String randomAlphanumeric(final int count); static String randomNumeric(final int count); static String random(final int count, final boolean letters, final boolean numbers); static String random(final int count, final int start, final int end, final boolean letters, final boolean numbers); static String random(final int count, final int start, final int end, final boolean letters, final boolean numbers, final char... chars); static String random(int count, int start, int end, final boolean letters, final boolean numbers,
                                final char[] chars, final Random random); static String random(final int count, final String chars); static String random(final int count, final char... chars);  }