### Question:
TranslationServiceOverrideUtil { public boolean shouldOverrideTranslation(final String key, final Locale locale) { return useCustomTranslations && pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER) && customTranslationResolver.isCustomTranslationActive(key, locale); }  boolean shouldOverrideTranslation(final String key, final Locale locale); String getCustomTranslation(final String key, final Locale locale, final String[] args);  }### Answer:
@Test public void shouldReturnTrueWhenShouldOverrideTranslation() { String key = "key"; Locale locale = new Locale("pl"); ReflectionTestUtils.setField(translationServiceOverrideUtil, "useCustomTranslations", true); given(pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER)).willReturn(true); given(customTranslationResolver.isCustomTranslationActive(key, locale)).willReturn(true); boolean result = translationServiceOverrideUtil.shouldOverrideTranslation(key, locale); assertTrue(result); }
@Test public void shouldReturnFalseWhenShouldOverrideTranslation() { String key = "key"; Locale locale = new Locale("pl"); ReflectionTestUtils.setField(translationServiceOverrideUtil, "useCustomTranslations", false); given(pluginStateResolver.isEnabled(CustomTranslationContants.PLUGIN_IDENTIFIER)).willReturn(false); given(customTranslationResolver.isCustomTranslationActive(key, locale)).willReturn(false); boolean result = translationServiceOverrideUtil.shouldOverrideTranslation(key, locale); assertFalse(result); }