Lang lang = new LangImpl(ninjaProperties);
// 1) with context and result => but result does not have a default lang
Result result = Results.ok();
Optional<String> language = lang.getLanguage(context, Optional.of(result));
assertEquals("de", language.get());
// 2) with context and result => result has already new lang set...
result = Results.ok();
cookie = Cookie.builder("NINJA_TEST" + NinjaConstant.LANG_COOKIE_SUFFIX, "en").build();
result.addCookie(cookie);
language = lang.getLanguage(context, Optional.of(result));
assertEquals("en", language.get());