### Question:
URLUtil { public static URL makeURLWithPathAndParam(String url, Map<String, String> param, String... path) throws RdapClientException { if (path != null && path.length != 0){ return makeURLWithPathAndParam(url, param, Arrays.asList(path)); }else{ return makeURLWithParam(url, param); } } private  URLUtil(); static URL makeURL(String url); static URL makeURLWithPath(String url, String... path); static URL makeURLWithPath(String url, List<String> path); static URL makeURLWithParam(String url, Map<String, String> param); static URL makeURLWithPathAndParam(String url,
            Map<String, String> param, String... path); static URL makeURLWithPathAndParam(String url,
            Map<String, String> param, List<String> path); static boolean isHttps(URL url);  }### Answer:
@Test public void test_makeURLWithPathAndParam() { String urlString; try { Map<String, String> map = new HashMap<String, String>(); map.put("p1", "1"); map.put("p2", "2"); urlString = URLUtil.makeURLWithPathAndParam(url, map, "ip", "192.168.1.1").toString(); } catch (RdapClientException e) { urlString = null; } assertTrue(urlWithPathAndParam.equals(urlString) ||urlWithPathAndParam1.equals(urlString)); }
@Test public void test_makeURLWithPathAndParam_list() { String urlString; try { Map<String, String> map = new HashMap<String, String>(); map.put("p1", "1"); map.put("p2", "2"); List<String> list = new ArrayList<String>(); list.add("ip"); list.add("192.168.1.1"); urlString = URLUtil.makeURLWithPathAndParam(url, map, list) .toString(); } catch (RdapClientException e) { urlString = null; } assertTrue(urlWithPathAndParam.equals(urlString) ||urlWithPathAndParam1.equals(urlString)); }