CancellableConnection () { return new HttpTestConnection(new HttpGet()) { @Override protected void test() throws Exception { URI endpoint = new URIBuilder(getRestApiUrl("api", "issues")) .addParameter("query", myDefaultSearch) .addParameter("fields", YouTrackIssue.DEFAULT_FIELDS) .addParameter("$top", String.valueOf(10)) .build(); myCurrentRequest.setURI(endpoint); getHttpClient().execute(myCurrentRequest, JsonResponseHandlerBuilder.fromGson(GSON) .errorHandler(YouTrackRepository.this::parseYouTrackError) .toNothing()); } }; }