### Question:
JwtCookieSession extends MapDecorator<String, Object> implements Session, DirtyListener { @Override public boolean isEmpty() { if (!super.isEmpty()) { return super.size() == 1 && super.containsKey(IG_EXP_SESSION_KEY); } else { return true; } } JwtCookieSession(final Request request,
                            final KeyPair pair,
                            final String cookieName,
                            final Logger logger,
                            final TimeService timeService,
                            final Duration sessionTimeout); @Override void onElementsRemoved(); @Override Object put(final String key, final Object value); @Override void putAll(final Map<? extends String, ?> m); @Override Object remove(final Object key); @Override void clear(); @Override Set<String> keySet(); @Override Collection<Object> values(); @Override Set<Entry<String, Object>> entrySet(); @Override void save(Response response); @Override boolean isEmpty(); static final String OPENIG_JWT_SESSION; }### Answer:
@Test public void shouldNotLoadUnexpectedSignedJwt() throws Exception { Request request = new Request(); setRequestCookie(request, ALTERED); JwtCookieSession session = newJwtSession(request); assertThat(session).isEmpty(); }
@Test public void shouldNotLoadInvalidJwt() throws Exception { Request request = new Request(); setRequestCookie(request, "Completely-invalid-JWT"); JwtCookieSession session = newJwtSession(request); assertThat(session).isEmpty(); }