### Question:
StringUtils { public static String prependSubstring(String uri, String subStr) { return prependSubstring(uri, subStr, true); }  static String removeFirstAndLastOccurrence(String input, String str); static String prependSubstring(String uri, String subStr); static String prependSubstring(String uri, String subStr, boolean checkAlreadyPrepended); static String prependSubstring(String uri, String subStr, boolean checkAlreadyPrepended, boolean shouldTrimWhitespaceFirst); static String removeLastOccurrence(String input, String subStr); static String resolveExpressions(String expression, Map<String, String> properties);  }### Answer:
@Test public void prependSubstringTest() { assertNull(StringUtils.prependSubstring(null, "any-string")); assertNull(StringUtils.prependSubstring("", null)); String whiteSpace = " "; assertEquals("any-string", StringUtils.prependSubstring(whiteSpace, "any-string")); assertEquals("any-string", StringUtils.prependSubstring("any-string", "any-string")); assertEquals("any-stringany-string", StringUtils.prependSubstring("any-string", "any-string", false)); assertEquals("any-string" + whiteSpace, StringUtils.prependSubstring(whiteSpace, "any-string", true, false)); assertEquals("any-string" + whiteSpace, StringUtils.prependSubstring(whiteSpace, "any-string", false, false)); String hasSlashes = " /blah/ "; assertEquals("/blah/", StringUtils.prependSubstring(hasSlashes, "/", true, true)); assertEquals(" assertEquals("/ /blah/ ", StringUtils.prependSubstring(hasSlashes, "/", false, false)); assertEquals("/ /blah/ ", StringUtils.prependSubstring(hasSlashes, "/", true, false)); }