URIUtil { public static URI updateWithQueryParameters( String url, Map<String, String> queryParameters) { if ((queryParameters == null) || queryParameters.isEmpty()) { return toURI(url); } UriBuilder uriBuilder = UriBuilder.fromUri(url); for (Map.Entry<String, String> parameter : queryParameters.entrySet()) { uriBuilder.replaceQueryParam( parameter.getKey(), parameter.getValue()); } return uriBuilder.build(); }  static URI addQueryConditionToURL(
		String resourceURL, String queryCondition); static String extractEndpointPathSegment(URL openAPISpecURL); static String extractJaxRSAppBasePathSegment(URL openAPISpecURL); static URL extractServerURL(URL openAPISpecURL); static String getLastPathSegment(String url); static boolean isValidOpenAPISpecURL(String endpointURL); static URI setPaginationLimitOnURL(String resourceURL, int limit); static URI toURI(String href); static URL toURL(String href); static URI updateWithQueryParameters(
		String url, Map<String, String> queryParameters); static void validateOpenAPISpecURL(String openAPISpecURL);  }
@Test public void testUpdateWithQueryParameters() { String url = "https: Map<String, String> parameters = new HashMap<>(); parameters.put("archive", "true"); parameters.put("key", "197797"); parameters.put("subscription", "true"); String uriString = String.valueOf( URIUtil.updateWithQueryParameters(url, parameters)); Assert.assertTrue( "URI has archive query parameter", uriString.contains("archive=true")); Assert.assertTrue( "URI has archive key parameter", uriString.contains("key=197797")); Assert.assertTrue( "URI has archive subscription parameter", uriString.contains("subscription=true")); }