UuidProvider implements SessionIdProvider { @Override public String readId(String value) { try { return UUID.fromString(value).toString(); } catch (Exception e) { logger.info("Cookie value vas not a valid UUID: {}", value); return null; } }  @Override String newId(); @Override String readId(String value); @Override void configure(SessionConfiguration configuration);  }
@Test public void testReadId() { UuidProvider provider = new UuidProvider(); assertNull(provider.readId("ABCDEFG")); assertNull(provider.readId("")); assertNull(provider.readId(null)); UUID uuid = UUID.randomUUID(); assertEquals(uuid.toString(), provider.readId(uuid.toString())); }