@Test public void shouldGetRandomName() { String name1 = StringTools.getRandomForeName(); String name2 = StringTools.getRandomForeName(); assertThat(name1.equals(name2), equalTo(false)); }
public static String getRandomForeName() { if (CollectionUtils.isEmpty(maleNames)) { loadMaleNames(); loadFemaleNames(); loadSurnames(); } boolean male = RandomUtils.nextBoolean(); if (male) { int randIndex = RandomUtils.nextInt(maleNames.size()); return maleNames.get(randIndex); } int randIndex = RandomUtils.nextInt(femaleNames.size()); return femaleNames.get(randIndex); }
StringTools { public static String getRandomForeName() { if (CollectionUtils.isEmpty(maleNames)) { loadMaleNames(); loadFemaleNames(); loadSurnames(); } boolean male = RandomUtils.nextBoolean(); if (male) { int randIndex = RandomUtils.nextInt(maleNames.size()); return maleNames.get(randIndex); } int randIndex = RandomUtils.nextInt(femaleNames.size()); return femaleNames.get(randIndex); } }
StringTools { public static String getRandomForeName() { if (CollectionUtils.isEmpty(maleNames)) { loadMaleNames(); loadFemaleNames(); loadSurnames(); } boolean male = RandomUtils.nextBoolean(); if (male) { int randIndex = RandomUtils.nextInt(maleNames.size()); return maleNames.get(randIndex); } int randIndex = RandomUtils.nextInt(femaleNames.size()); return femaleNames.get(randIndex); }  }
StringTools { public static String getRandomForeName() { if (CollectionUtils.isEmpty(maleNames)) { loadMaleNames(); loadFemaleNames(); loadSurnames(); } boolean male = RandomUtils.nextBoolean(); if (male) { int randIndex = RandomUtils.nextInt(maleNames.size()); return maleNames.get(randIndex); } int randIndex = RandomUtils.nextInt(femaleNames.size()); return femaleNames.get(randIndex); }  static int getLevenshteinDistance(String str1, String str2); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search); boolean isNotTooShort(String string); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance); static String getCompletingString(String string, int begin, int end); static List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords); static boolean noContentInHtml(String text); static List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength); static String getRandomForeName(); static String getRandomSurname(); static String getFirstHtmlWithContent(String html); static String getMetaDataFromHTML(String html); static String addMetaDataToHtml(String htmlText, String metaData); }
StringTools { public static String getRandomForeName() { if (CollectionUtils.isEmpty(maleNames)) { loadMaleNames(); loadFemaleNames(); loadSurnames(); } boolean male = RandomUtils.nextBoolean(); if (male) { int randIndex = RandomUtils.nextInt(maleNames.size()); return maleNames.get(randIndex); } int randIndex = RandomUtils.nextInt(femaleNames.size()); return femaleNames.get(randIndex); }  static int getLevenshteinDistance(String str1, String str2); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search); boolean isNotTooShort(String string); static Set<String> getApproximatelyMatchingStringList(String sourceString, String search, int maxDistance); static String getCompletingString(String string, int begin, int end); static List<MatchingWindow> getMatchingWindowsAboveThreshold(String text, String search, double threshold); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength); static Set<String> splitIntoWordsWithLengthHigherThan(String string, int minLength, String... ignoreWords); static boolean noContentInHtml(String text); static List<String> getRegexMatchesWithMinLength(String text, String regex, int minLength); static String getRandomForeName(); static String getRandomSurname(); static String getFirstHtmlWithContent(String html); static String getMetaDataFromHTML(String html); static String addMetaDataToHtml(String htmlText, String metaData);  }