private static Integer getFreeId()
    {
        if (!RECYCLE.isEmpty())
        {
            final Integer id = RECYCLE.poll();
            IDS.add(id);
            return id;
        }
        if (IDS.size() == Integer.MAX_VALUE)
        {
            throw new LionEngineException(ERROR_FREE_ID);
        }
        Integer id;
        while (IDS.contains(id = Integer.valueOf(lastId))) // CHECKSTYLE IGNORE LINE: TrailingComment|InnerAssignment
        {
            lastId++;
        }
        IDS.add(id);
        return id;
    }
private static Integer getFreeId ( ) { if ( ! RECYCLE . isEmpty ( ) ) { final Integer id = RECYCLE . poll ( ) ; IDS . add ( id ) ; return id ; } if ( IDS . size ( ) == Integer . MAX_VALUE ) { throw new LionEngineException ( ERROR_FREE_ID ) ; } Integer id ; while ( IDS . contains ( id = Integer . valueOf ( lastId ) ) ) { lastId ++ ; } IDS . add ( id ) ; return id ; }
Get the next unused ID.

@return The next unused ID.
@throws LionEngineException If there is more than {@link Integer#MAX_VALUE} at the same time.