void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); while (!indicator.isCanceled()) { if (semaphore.waitFor(500)) { break; } } final Boolean connected = connectedRef.get(); if (connected == null) { return; } callback.connectionTested(connected, connection.getStatusText()); }