LangImpl implements Lang { @Override public void clearLanguage(Result result) { Cookie defaultLangCookie = generateNinjaLanguageCookie(); result.unsetCookie(defaultLangCookie.getName()); } @Inject  LangImpl(NinjaProperties ninjaProperties); @Override void clearLanguage(Result result); @Override Result setLanguage(String locale, Result result); @Override Optional<String> getLanguage(Context context, Optional<Result> result); @Override boolean isLanguageDirectlySupportedByThisApplication(String language); @Override Locale getLocaleFromStringOrDefault(Optional<String> language);  }
@Test public void testClearLanguage() { Cookie cookie = Cookie.builder("NINJA_TEST" + NinjaConstant.LANG_COOKIE_SUFFIX, "de").build(); when(ninjaProperties.getOrDie(NinjaConstant.applicationCookiePrefix)).thenReturn("NINJA_TEST"); Lang lang = new LangImpl(ninjaProperties); Result result = Results.ok(); lang.clearLanguage(result); Cookie returnCookie = result.getCookie(cookie.getName()); assertEquals("", returnCookie.getValue()); assertEquals(0, returnCookie.getMaxAge()); }