singleResponse
Retrieves the single response from a list of Message.Response
objects.
This function ensures that the list contains exactly one response. If the list contains more than one response, an IllegalArgumentException
is thrown. If the list is empty, a NoSuchElementException
is thrown.
Return
The single Message.Response
present in the list.
Throws
if the list contains more than one response.
if the list is empty.