### Question:
StringUtils { public static String replaceSubstring(final String s, final int startIndex, final int endIndex, final String replacement) { final StringBuilder sb = new StringBuilder(); sb.append(s.substring(0, startIndex)); sb.append(replacement); sb.append(s.substring(endIndex)); return sb.toString(); }  static String replaceSubstring(final String s, final int startIndex, final int endIndex,
            final String replacement); static List<E> parseListEnums(final String s, final Class<E> enumClass); static E parseEnum(final String s, final Class<E> enumClass); static E fromValue(final Class<E> enumClass, final String value); static String join(final List<String> substrings, final String join); static String join(final List<String> substrings); static boolean containsPattern(final String string, final String pattern); static boolean containsPattern(final String string, final Pattern pattern);  }### Answer:
@Test public void shouldReplaceSubstring_withStringStartIndexEndIndexAndReplacment() { final String s = "leftMIDDLEright"; final int startIndex = 4; final int endIndex = 10; final String replacement = "CENTRE"; final String result = StringUtils.replaceSubstring(s, startIndex, endIndex, replacement); assertEquals("leftCENTREright", result); }