}
@Test
public void testSipUri() throws Exception
{
SipURI orig = new SipURIImpl("sip:foo@bar.com;transport=tcp?to=sip:bob%40biloxi.com");
SipURI readOnly = new ReadOnlySipURI((SipURI) orig.clone());
assertEquals(orig, readOnly);
try { readOnly.setParameter("foo", "bar"); fail();} catch (IllegalStateException e) {}
try { readOnly.removeParameter("transport"); fail();} catch (IllegalStateException e) {}
try { readOnly.setHeader("subject", "toto"); fail();} catch (IllegalStateException e) {}
try { readOnly.removeHeader("to"); fail();} catch (IllegalStateException e) {}
assertEquals(orig, readOnly);
assertEquals(readOnly, orig);
assertEquals(orig.toString(), readOnly.toString());
URI clone = (URI) readOnly.clone();
clone.setParameter("a", "b");
testSerializable(readOnly);
}