@Test public void testRandomize() { StringRandomizer randomizer = new StringRandomizer("asdf", "0"); String randomized = randomizer.randomize(); assertThat(randomized).isNotEqualTo("asdf"); }
public String randomize() { StringBuilder builder = new StringBuilder(text); int charactersToRandomize = (int) (factor * nativeLength); Set<Integer> visitedIndices = new HashSet<Integer>(); for (int i = 0; i < charactersToRandomize; ++i) { String replacement = getRandomCharacter(pool); replaceRandomCharacter(builder, replacement, visitedIndices); } return builder.toString(); }
StringRandomizer { public String randomize() { StringBuilder builder = new StringBuilder(text); int charactersToRandomize = (int) (factor * nativeLength); Set<Integer> visitedIndices = new HashSet<Integer>(); for (int i = 0; i < charactersToRandomize; ++i) { String replacement = getRandomCharacter(pool); replaceRandomCharacter(builder, replacement, visitedIndices); } return builder.toString(); } }
StringRandomizer { public String randomize() { StringBuilder builder = new StringBuilder(text); int charactersToRandomize = (int) (factor * nativeLength); Set<Integer> visitedIndices = new HashSet<Integer>(); for (int i = 0; i < charactersToRandomize; ++i) { String replacement = getRandomCharacter(pool); replaceRandomCharacter(builder, replacement, visitedIndices); } return builder.toString(); } StringRandomizer(String text, String pool, String seed);  StringRandomizer(String text, String pool); private  StringRandomizer(String text, String pool, Random random); }
StringRandomizer { public String randomize() { StringBuilder builder = new StringBuilder(text); int charactersToRandomize = (int) (factor * nativeLength); Set<Integer> visitedIndices = new HashSet<Integer>(); for (int i = 0; i < charactersToRandomize; ++i) { String replacement = getRandomCharacter(pool); replaceRandomCharacter(builder, replacement, visitedIndices); } return builder.toString(); } StringRandomizer(String text, String pool, String seed);  StringRandomizer(String text, String pool); private  StringRandomizer(String text, String pool, Random random); void setFactor(float factor); float getFactor(); String randomize(); }
StringRandomizer { public String randomize() { StringBuilder builder = new StringBuilder(text); int charactersToRandomize = (int) (factor * nativeLength); Set<Integer> visitedIndices = new HashSet<Integer>(); for (int i = 0; i < charactersToRandomize; ++i) { String replacement = getRandomCharacter(pool); replaceRandomCharacter(builder, replacement, visitedIndices); } return builder.toString(); } StringRandomizer(String text, String pool, String seed);  StringRandomizer(String text, String pool); private  StringRandomizer(String text, String pool, Random random); void setFactor(float factor); float getFactor(); String randomize();  }