public static URL toURL(URI uri) throws MalformedURLException {
  if (!uri.isAbsolute())   throw new MockIllegalArgumentException("URI is not absolute");
  return MockURL.URL(uri.toString());
}

public static URL toURL ( URI uri ) throws MalformedURLException { if ( ! uri . isAbsolute ( ) ) throw new MockIllegalArgumentException ( "URI is not absolute" ) ; return MockURL . URL ( uri . toString ( ) ) ; }
uri is a final class . it seems there is the need to only mock one of its methods , in which url is used . still we need a staticreplacementmock , whereas staticreplacementmethod cannot be used : (
