public static List<Locale> getAvailableAcceptedLocales() {
    return getAcceptableLanguages()
        .map(languageRanges -> Locale.filter(languageRanges, AVAILABLE_LOCALES))
        .orElseGet(Collections::emptyList);
  }
@Test
  void getAvailableAcceptedLocales() {
    when(clientConnectionManager.getAcceptableLanguages(any()))
        .thenReturn(Optional.empty());

    assertTrue(getRequestAttributes().getAvailableAcceptedLocalesList().isEmpty());

    when(clientConnectionManager.getAcceptableLanguages(any()))
        .thenReturn(Optional.of(Locale.LanguageRange.parse("en,ja")));

    final GetRequestAttributesResponse response = getRequestAttributes();

    assertFalse(response.getAvailableAcceptedLocalesList().isEmpty());
    response.getAvailableAcceptedLocalesList().forEach(languageTag -> {
      final Locale locale = Locale.forLanguageTag(languageTag);
      assertTrue("en".equals(locale.getLanguage()) || "ja".equals(locale.getLanguage()));
    });
  }