@Test public void shouldReturnLocale() throws Exception { when(request.getLocale()).thenReturn(Locale.GERMAN); final Optional<Locale> localeOptional = acceptHeaderLocaleProvider.resolveLocale(request); Assert.assertTrue("locale should be present", localeOptional.isPresent()); Assert.assertEquals("locale should be German", Locale.GERMAN, localeOptional.get()); }
public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); }
AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); } }
AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); }  }
AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); }  Optional<Locale> resolveLocale(final HttpServletRequest request); }
AcceptHeaderLocaleProvider implements LocaleProvider { public Optional<Locale> resolveLocale(final HttpServletRequest request) { return Optional.fromNullable(request.getLocale()); }  Optional<Locale> resolveLocale(final HttpServletRequest request);  }