### Question:
CouchURIHelper { public URI changesUri(Map<String, Object> query) { String base_uri = String.format( "%s/%s", this.rootUriString, "_changes" ); if(query.containsKey("since")){ Object since = query.get("since"); if(!(since instanceof String)){ query.put("since", JSONUtils.toJson(since)); } } String uri = appendQueryString(base_uri, query); return uriFor(uri); } CouchURIHelper(URI rootUri); URI getRootUri(); URI changesUri(Map<String, Object> query); URI bulkDocsUri(); URI revsDiffUri(); URI documentUri(String documentId); URI documentUri(String documentId, Map<String, Object> query); URI attachmentUri(String documentId, String attachmentId); URI attachmentUri(String documentId, Map<String, Object> query, String attachmentId);  }### Answer:
@Test public void buildChangesUri_options_optionsEncoded() throws Exception { URI expected = new URI(uriBase + "/test/_changes?limit=100&since=%22%5B%5D%22"); Map<String, Object> options = new HashMap<String, Object>(); options.put("since", "\"[]\""); options.put("limit", 100); URI actual = helper(path+"/test").changesUri(options); Assert.assertEquals(expected, actual); }
@Test public void buildChangesUri_woOptions() throws Exception { URI expected = new URI(uriBase + "/test/_changes"); URI actual = helper(path+"/test").changesUri(new HashMap<String, Object>()); Assert.assertEquals(expected, actual); }