code: public SipResponse findMostRecentResponse(int statusCode) {
      List<SipResponse> responses = getAllReceivedResponses();
  
      ListIterator<SipResponse> i = responses.listIterator(responses.size());
      while (i.hasPrevious()) {
        SipResponse resp = i.previous();
        if (resp.getStatusCode() == statusCode) {
          return resp;
        }
      }
  
      return null;
    }
docs: Finds the last received response with status code matching the given parameter.
  
  @param statusCode Indicates the type of response to return.
  @return SipResponse object or null, if not found.