SipInitialLine extends SipParser { @Override protected abstract SipInitialLine clone(); protected  SipInitialLine(); abstract boolean equals(final Object other); abstract Buffer getBuffer(); static boolean isResponseLine(final Buffer buffer); static final SipInitialLine parse(final Buffer buffer); static final SipInitialLine parse(final Buffer part1, final Buffer part2, final Buffer part3); SipRequestLine toRequestLine(); SipResponseLine toResponseLine(); boolean isResponseLine(); boolean isRequestLine(); abstract void getBytes(Buffer dst);  }
@Test public void testCloneRequestLine() throws Exception { final String s = "INVITE sip:hello@aboutsip.com;transport=udp SIP/2.0"; final SipRequestLine line1 = parseRequestLine(s); final SipRequestLine line2 = line1.clone(); assertThat(line1.toString(), is(line2.toString())); final SipURI uri1 = (SipURI) line1.getRequestUri(); final SipURI uri2 = (SipURI) line2.getRequestUri(); assertThat(uri1.getPort(), is(uri2.getPort())); assertThat(uri1.getHost(), is(uri2.getHost())); assertThat(uri1.getHost().toString(), is(uri2.getHost().toString())); }