URLBuilder { public URL build() { port = port < 0 ? 0 : port; int firstNonSlash = 0; if (path != null) { while (firstNonSlash < path.length() && path.charAt(firstNonSlash) == '/') { firstNonSlash++; } if (firstNonSlash >= path.length()) { path = ""; } else if (firstNonSlash > 0) { path = path.substring(firstNonSlash); } } if (CollectionUtils.isEmptyMap(methodParameters)) { return new URL(protocol, username, password, host, port, path, parameters); } else { return new URL(protocol, username, password, host, port, path, parameters, methodParameters); } } URLBuilder();  URLBuilder(String protocol, String host, int port);  URLBuilder(String protocol, String host, int port, String[] pairs);  URLBuilder(String protocol, String host, int port, Map<String, String> parameters);  URLBuilder(String protocol, String host, int port, String path);  URLBuilder(String protocol, String host, int port, String path, String... pairs);  URLBuilder(String protocol, String host, int port, String path, Map<String, String> parameters);  URLBuilder(String protocol,
                      String username,
                      String password,
                      String host,
                      int port,
                      String path, Map<String, String> parameters);  URLBuilder(String protocol,
                      String username,
                      String password,
                      String host,
                      int port,
                      String path, Map<String, String> parameters,
                      Map<String, Map<String, String>> methodParameters); static URLBuilder from(URL url); URL build(); URLBuilder setProtocol(String protocol); URLBuilder setUsername(String username); URLBuilder setPassword(String password); URLBuilder setHost(String host); URLBuilder setPort(int port); URLBuilder setAddress(String address); URLBuilder setPath(String path); URLBuilder addParameterAndEncoded(String key, String value); URLBuilder addParameter(String key, boolean value); URLBuilder addParameter(String key, char value); URLBuilder addParameter(String key, byte value); URLBuilder addParameter(String key, short value); URLBuilder addParameter(String key, int value); URLBuilder addParameter(String key, long value); URLBuilder addParameter(String key, float value); URLBuilder addParameter(String key, double value); URLBuilder addParameter(String key, Enum<?> value); URLBuilder addParameter(String key, Number value); URLBuilder addParameter(String key, CharSequence value); URLBuilder addParameter(String key, String value); URLBuilder addMethodParameter(String method, String key, String value); URLBuilder addParameterIfAbsent(String key, String value); URLBuilder addMethodParameterIfAbsent(String method, String key, String value); URLBuilder addParameters(Map<String, String> parameters); URLBuilder addMethodParameters(Map<String, Map<String, String>> methodParameters); URLBuilder addParametersIfAbsent(Map<String, String> parameters); URLBuilder addParameters(String... pairs); URLBuilder addParameterString(String query); URLBuilder removeParameter(String key); URLBuilder removeParameters(Collection<String> keys); URLBuilder removeParameters(String... keys); URLBuilder clearParameters(); boolean hasParameter(String key); boolean hasMethodParameter(String method, String key); String getParameter(String key); String getMethodParameter(String method, String key);  }
@Test public void testNoArgConstructor() { URL url = new URLBuilder().build(); assertThat(url.toString(), equalTo("")); }