if getSessions(Arrays.asList(sessionId)) returns empty list you'll got NoSuchElement exception here. May be we should return null in this case ?