MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / scrambleWord

Method scrambleWord

annotations/AtUnitExample4.java:23–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21 }
22 public String getWord() { return word; }
23 public String scrambleWord() {
24 List<Character> chars = Arrays.asList(
25 ConvertTo.boxed(word.toCharArray()));
26 Collections.shuffle(chars, rand);
27 StringBuilder result = new StringBuilder();
28 for(char ch : chars)
29 result.append(ch);
30 return result.toString();
31 }
32 @TestProperty
33 static List<String> input =
34 Arrays.asList(theory.split(" "));

Callers 2

scramble1Method · 0.95
scramble2Method · 0.95

Calls 3

boxedMethod · 0.95
appendMethod · 0.80
toStringMethod · 0.45

Tested by

no test coverage detected