### Question:
StringUri { public static String appendQueryParam(String uri, String paramName, String paramValue) { Map<String, String> params = getQueryParamsFromUri(uri); params.put(paramName, paramValue); return withQuery(removeAllQueryParams(uri), params); } 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 appendQueryParam() { String uri1 = "http: String uri2 = "http: String uri3 = "http: String actual1 = StringUri.appendQueryParam(uri1, "param3", "value3"); Map<String, String> params1 = StringUri.getQueryParamsFromUri(actual1); assertThat(params1).hasSize(3) .containsEntry("param1", "value1") .containsEntry("param2", "value2") .containsEntry("param3", "value3"); String actual2 = StringUri.appendQueryParam(uri1, "param2", "value2"); Map<String, String> params2 = StringUri.getQueryParamsFromUri(actual2); assertThat(params2).hasSize(2) .containsEntry("param1", "value1") .containsEntry("param2", "value2"); String actual3 = StringUri.appendQueryParam(uri1, "param2", "value3"); Map<String, String> params3 = StringUri.getQueryParamsFromUri(actual3); assertThat(params3).hasSize(2) .containsEntry("param1", "value1") .containsEntry("param2", "value3"); String actual4 = StringUri.appendQueryParam(uri2, "param", "value"); Map<String, String> params4 = StringUri.getQueryParamsFromUri(actual4); assertThat(params4).hasSize(1) .containsEntry("param", "value"); String actual5 = StringUri.appendQueryParam(uri3, "param", "value"); Map<String, String> params5 = StringUri.getQueryParamsFromUri(actual5); assertThat(params5).hasSize(1) .containsEntry("param", "value"); }