### Question:
CustomTranslationsListViewHooks { public void setLocaleToDefault(final ViewDefinitionState view) { FieldComponent localeField = (FieldComponent) view.getComponentByReference(LOCALE); if (localeField.getFieldValue() == null) { localeField.setFieldValue(LocaleContextHolder.getLocale().getLanguage()); localeField.requestComponentUpdateState(); } }  void updateRibbonState(final ViewDefinitionState view); void setLocaleToDefault(final ViewDefinitionState view); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view, final ComponentState state, final String[] args); void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view);  }### Answer:
@Test public void shouldSetLocaleToDefaultIfLocaleIsNull() { given(view.getComponentByReference(LOCALE)).willReturn(localeField); given(localeField.getFieldValue()).willReturn(null); customTranslationsListViewHooks.setLocaleToDefault(view); verify(localeField).setFieldValue(Mockito.anyString()); }
@Test public void shouldntSetLocaleToDefaultIfLocaleIsntNull() { String locale = "pl"; given(view.getComponentByReference(LOCALE)).willReturn(localeField); given(localeField.getFieldValue()).willReturn(locale); customTranslationsListViewHooks.setLocaleToDefault(view); verify(localeField, never()).setFieldValue(Mockito.anyString()); }