code: public static boolean responseReceived(int statusCode, MessageListener messageListener) {
      ArrayList<SipResponse> responses = messageListener.getAllReceivedResponses();
  
      for (SipResponse r : responses) {
        if (statusCode == r.getStatusCode()) {
          return true;
        }
      }
  
      return false;
    }
docs: Check the given message listener object received a response with the indicated status
  code.
  
  @param statusCode the code we want to find
  @param messageListener the {@link MessageListener} we want to check
  @return true if a received response matches the given statusCode