### Question:
StringUri { public static String copyQueryParams(String sourceUri, String targetUri) { if (!containsQueryParams(sourceUri)) { return targetUri; } return targetUri + (containsQueryParams(targetUri) ? "&" : "?") + sourceUri.split("\\?")[1]; } private  StringUri(); static String fromElements(Object... elements); static String withQuery(String uri, Map<String, ?> requestParams); static String withQuery(String uri, String paramName, String paramValue); static Map<String, String> getQueryParamsFromUri(String uri); static String decode(String url); static boolean isUri(String stringToCheck); static boolean containsProtocol(String urlToCheck); static boolean containsQueryParam(String uri, String paramName); static String appendQueryParam(String uri, String paramName, String paramValue); static String removeAllQueryParams(String uri); static Optional<String> getVersion(String uri); static String copyQueryParams(String sourceUri, String targetUri);  }### Answer:
@Test void copyQueryParams() { String source1 = "http: String target1 = "http: assertThat(StringUri.copyQueryParams(source1, target1)) .isEqualTo("http: String source2 = "http: String target2 = "http: assertThat(StringUri.copyQueryParams(source2, target2)) .isEqualTo("http: String source3 = "http: String target3 = "http: assertThat(StringUri.copyQueryParams(source3, target3)) .isEqualTo("http: }