### Question:
DefaultLocaleProvider implements LocaleProvider { @Override public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(locale); } DefaultLocaleProvider(Locale locale);  DefaultLocaleProvider(); @Override Optional<Locale> resolveLocale(final HttpServletRequest request); void setLocale(final Locale locale);  }### Answer:
@Test public void testShouldNotReturnNull() throws Exception { Assert.assertTrue("should return value", defaultLocaleProvider.resolveLocale(null).isPresent()); }
@Test public void shouldReturnUsDefault() throws Exception { Assert.assertEquals("should return absent", Locale.US, defaultLocaleProvider.resolveLocale(request).get()); }