@Test public void shouldRandomizeString() { String orig = "changeMyCase"; String result; do { result = Functions.randomizeLetterCase(orig); } while (result.equals(orig)); assertTrue(result.equalsIgnoreCase(orig)); }
@Function public static String randomizeLetterCase(String text) { StringBuilder result = new StringBuilder(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (RANDOM.nextBoolean()) { c = toUpperCase(c); } else { c = toLowerCase(c); } result.append(c); } return result.toString(); }
Functions { @Function public static String randomizeLetterCase(String text) { StringBuilder result = new StringBuilder(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (RANDOM.nextBoolean()) { c = toUpperCase(c); } else { c = toLowerCase(c); } result.append(c); } return result.toString(); } }
Functions { @Function public static String randomizeLetterCase(String text) { StringBuilder result = new StringBuilder(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (RANDOM.nextBoolean()) { c = toUpperCase(c); } else { c = toLowerCase(c); } result.append(c); } return result.toString(); } private  Functions(); }
Functions { @Function public static String randomizeLetterCase(String text) { StringBuilder result = new StringBuilder(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (RANDOM.nextBoolean()) { c = toUpperCase(c); } else { c = toLowerCase(c); } result.append(c); } return result.toString(); } private  Functions(); @Function static String base64Encode(String login); @Function static String append(String... strings); @Function static String handshakeKey(); @Function static String handshakeHash(String wsKey); @Function static byte[] randomBytes(int length); @Function static byte[] randomBytesUTF8(int length); @Function static byte[] randomBytesInvalidUTF8(int length); @Function static byte[] randomBytesUnalignedUTF8(int length, int unalignAt); @Function static byte[] copyOfRange(byte[] original, int from, int to); @Function static String randomizeLetterCase(String text); @Function static String randomHeaderNot(String header); @Function static String randomCaseNot(String value); @Function static String randomMethodNot(String method); }
Functions { @Function public static String randomizeLetterCase(String text) { StringBuilder result = new StringBuilder(); for (int i = 0; i < text.length(); i++) { char c = text.charAt(i); if (RANDOM.nextBoolean()) { c = toUpperCase(c); } else { c = toLowerCase(c); } result.append(c); } return result.toString(); } private  Functions(); @Function static String base64Encode(String login); @Function static String append(String... strings); @Function static String handshakeKey(); @Function static String handshakeHash(String wsKey); @Function static byte[] randomBytes(int length); @Function static byte[] randomBytesUTF8(int length); @Function static byte[] randomBytesInvalidUTF8(int length); @Function static byte[] randomBytesUnalignedUTF8(int length, int unalignAt); @Function static byte[] copyOfRange(byte[] original, int from, int to); @Function static String randomizeLetterCase(String text); @Function static String randomHeaderNot(String header); @Function static String randomCaseNot(String value); @Function static String randomMethodNot(String method);  }