### Question:
ToUpperCaseFunction implements Function<String, String> { @Override @Nullable public String apply(@Nullable String input) { return input == null ? null : input.toUpperCase(locale); } ToUpperCaseFunction(@Nonnull Locale locale);  ToUpperCaseFunction(); @Override @Nullable String apply(@Nullable String input);  }### Answer:
@Test public void shouldConvertToUpperCase() { ToUpperCaseFunction toUpperCaseFunction = new ToUpperCaseFunction(Locale.ENGLISH); String upperCased = toUpperCaseFunction.apply(STRING_IN_LOWER_CASE); assertThat(upperCased, is(STRING_IN_UPPER_CASE)); }
@Test public void shouldConvertToUpperCaseWhenNoLocaleIsProvided() { ToUpperCaseFunction toUpperCaseFunction = new ToUpperCaseFunction(); String upperCased = toUpperCaseFunction.apply(STRING_IN_LOWER_CASE); assertThat(upperCased, is(STRING_IN_UPPER_CASE)); }
@Test public void shouldReturnNullIfInputIsNull() { ToUpperCaseFunction toUpperCaseFunction = new ToUpperCaseFunction(Locale.ENGLISH); String upperCased = toUpperCaseFunction.apply(null); assertThat(upperCased, nullValue()); }