URIHeaderDelegate implements RuntimeDelegate.HeaderDelegate<URI> { @Override public String toString(URI uri) { if (uri == null) { throw new IllegalArgumentException(); } return uri.toASCIIString(); }  @Override URI fromString(String header); @Override String toString(URI uri);  }
@Test public void testToString() throws Exception { assertEquals("http: }
@Test(expected = IllegalArgumentException.class) public void throwsExceptionWhenUriIsNull() throws Exception { uriHeaderDelegate.toString(null); }