### Question:
StringUtil { public static String replace(String str, String from, String to) { if (from.equals(to)) { return str; } String[] split = split(str, from, Integer.MAX_VALUE); return join(split, to); } private  StringUtil(); static boolean isEmpty(String val); static boolean isNotEmpty(String val); static boolean isBlank(final CharSequence cs); static boolean isNotBlank(final CharSequence cs); static boolean contains(String val, char charToSearchFor); static boolean equalsIgnoreCase(String str1, String str2); static String[] split(String str, String token, int max); static String replace(String str, String from, String to); static String trim(final String str); static String trimToNull(String str); static String join(Object[] values, String joinToken); static T parse(String val, Class<T> type); static String capitalize(final String str); static String uncapitalize(final String str); static boolean endsWithIgnoreCase(String str, String suffix); static String stripEnd(final String str, final String stripChars);  }### Answer:
@Test @Ignore("only needed for manual performance tests") public void testStringsReplacePerformance() { String val = "This is my fnx test suite for fnx replacement to fnx=fnx"; long start = System.nanoTime(); for (int i = 1; i < 10000000; i++) { StringUtil.replace(val, "fnx", "weirdo function"); } long stop = System.nanoTime(); System.out.println("took: " + TimeUnit.NANOSECONDS.toMillis(stop - start)); }