A MalformedUrlException shouldn't be thrown when calling getUrl since the class does not allow  creation of a malformed url (no string creation).