}
}
private void setCurrentId(UserId userId, long currentId) {
if (userId2CurrentIdMap.containsKey(userId)) {
UserIdRange userIdRange = userId2RangeEndMap.get(userId);
long limitForUser = userIdRange.getEnd();
if(currentId > limitForUser) {
throw new CannotGenerateFreshEntityIdForUserException(userIdRange);
}
userId2CurrentIdMap.put(userId, currentId);
}