CancellableConnection () { return new CancellableConnection() { private final GithubApiRequestExecutor myExecutor = getExecutor(); private final ProgressIndicator myIndicator = new EmptyProgressIndicator(); @Override protected void doTest() throws Exception { try { myExecutor.execute(myIndicator, GithubApiRequests.Repos.get(getServer(), getRepoAuthor(), getRepoName())); } catch (ProcessCanceledException ignore) { } } @Override public void cancel() { myIndicator.cancel(); } }; }