final Subject subject = sessions.read(new SessionDbRead<Subject>(){
@Override
public Subject execute(final Map<String, Session> db) {
Session session = db.get((String)credentials);
if (session == null) return null;
if (session.isValid())
return session.getSubject();
return null;
}
});