ok.setHeader(createRiContact());
	public void testCreateAck() {		try {			// 1. Create and send the original request			Request invite = createTiInviteRequest(null, null, null);			RequestEvent receivedRequestEvent = null;			ClientTransaction tran = null;			try {				tran = tiSipProvider.getNewClientTransaction(invite);				eventCollector.collectRequestEvent(riSipProvider);				tran.sendRequest();				waitForMessage();				receivedRequestEvent =					eventCollector.extractCollectedRequestEvent();				if (receivedRequestEvent == null					|| receivedRequestEvent.getRequest() == null)					throw new TiUnexpectedError("The sent request was not received by the RI!");			} catch (TooManyListenersException ex) {				throw new TckInternalError(					"A TooManyListenersException was thrown while trying to add "						+ "a SipListener to an RI SipProvider.",					ex);			} catch (SipException ex) {				throw new TiUnexpectedError(					"The TI failed to send the request!",					ex);			}			Request receivedRequest = receivedRequestEvent.getRequest();			// 2. Create and send the response			Response ok = null;			try {				ok =					riMessageFactory.createResponse(						Response.OK,						receivedRequest);			} catch (ParseException ex) {				throw new TckInternalError(					"Failed to create an OK response!",					ex);			}			//Send the response using the RI and collect using TI			try {				eventCollector.collectResponseEvent(tiSipProvider);			} catch (TooManyListenersException ex) {				throw new TiUnexpectedError("Error while trying to add riSipProvider");			}			try {				riSipProvider.sendResponse(ok);			} catch (SipException ex) {				throw new TckInternalError(					"Could not send back the response",					ex);			}			waitForMessage();			ResponseEvent responseEvent =				eventCollector.extractCollectedResponseEvent();			//3. Now let's create the ack			if (responseEvent == null || responseEvent.getResponse() == null)				throw new TiUnexpectedError("The TI failed to receive the response!");			if (responseEvent.getClientTransaction() != tran)				throw new TiUnexpectedError(					"The TI has associated a new ClientTransaction to a response "						+ "instead of using existing one!");			Request ack = null;			try {				ack = tran.createAck();			} catch (SipException ex) {				ex.printStackTrace();				fail("A SipException was thrown while creating an ack request");			}			assertNotNull("ClientTransaction.createAck returned null!", ack);			assertEquals(				"The created request did not have a CANCEL method.",				ack.getMethod(),				Request.ACK);			assertEquals(				"Request-URIs of the original and the ack request do not match",				ack.getRequestURI(),				invite.getRequestURI());			assertEquals(				"Call-IDs of the original and the ack request do not match",				ack.getHeader(CallIdHeader.NAME),				invite.getHeader(CallIdHeader.NAME));			assertEquals(				"ToHeaders of the original and the ack request do not match",				ack.getHeader(ToHeader.NAME),				invite.getHeader(ToHeader.NAME));			assertTrue(				"The CSeqHeader's sequence number of the original and "					+ "the ack request do not match",				((CSeqHeader) ack.getHeader(CSeqHeader.NAME))					.getSequenceNumber()					== ((CSeqHeader) invite.getHeader(CSeqHeader.NAME))						.getSequenceNumber());			assertEquals(				"The CSeqHeader's method of the ack request was not ACK",				((CSeqHeader) ack.getHeader(CSeqHeader.NAME)).getMethod(),				Request.ACK);		} catch (Throwable exc) {			exc.printStackTrace();			fail(exc.getClass().getName() + ": " + exc.getMessage());		}		assertTrue(new Exception().getStackTrace()[0].toString(), true);	}