### Question:
Vaadin7 implements UiFrameworkExtension { @Override public Locale getLocale() { UI ui = UI.getCurrent(); if (ui != null) { Locale locale = ui.getLocale(); if (locale != null) { return locale; } } return Locale.GERMAN; }  @Override Locale getLocale(); @Override ComponentWrapperFactory getComponentWrapperFactory(); @Override Stream<?> getChildComponents(Object uiComponent);  }### Answer:
@Test public void testGetUiLocale() { assertThat(UI.getCurrent(), is(nullValue())); assertThat(UiFramework.getLocale(), is(Locale.GERMAN)); UI ui = MockUi.mockUi(); when(ui.getLocale()).thenReturn(Locale.ITALIAN); assertThat(UiFramework.getLocale(), is(Locale.ITALIAN)); }