collectEventsAndPoll

Collect all events of the expected type (set during construction) starting with event provided as an argument and continuing with the top event on the event source. Collection stops as soon as a non comment or comment of the unexpected type is encountered.

Return

the event provided as an argument, if it is not collected; Otherwise, the first event that is not collected.

Parameters

event

the first event to attempt to collect.