def get_next_ids(self, n=None):
if n > self.available():<EOL><INDENT>raise IllegalState('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>next_list = []<EOL>x = <NUM_LIT:0><EOL>while x < n:<EOL><INDENT>try:<EOL><INDENT>next_list.append(next(self))<EOL><DEDENT>except Exception:  <EOL><INDENT>raise OperationFailed()<EOL><DEDENT>x = x + <NUM_LIT:1><EOL><DEDENT>return next_list<EOL><DEDENT>
Gets the next set of Ids in this list.

        The specified amount must be less than or equal to the return
        from available().

        arg:    n (cardinal): the number of Id elements requested which
                must be less than or equal to available()
        return: (osid.id.Id) - an array of Id elements.  The length of
                the array is less than or equal to the number specified.
        raise:  IllegalState - no more elements available in this list
        raise:  OperationFailed - unable to complete request
        compliance: mandatory - This method must be implemented.