boolean (@NotNull final ProgressIndicator indicator, ExternalSystemTaskNotificationListener @NotNull ... listeners) { indicator.setIndeterminate(true); ExternalSystemTaskNotificationListenerAdapter adapter = new ExternalSystemTaskNotificationListenerAdapter() { @Override public void onStatusChange(@NotNull ExternalSystemTaskNotificationEvent event) { indicator.setText(wrapProgressText(event.getDescription())); } }; final ExternalSystemTaskNotificationListener[] ls; if (listeners.length > 0) { ls = ArrayUtil.append(listeners, adapter); } else { ls = new ExternalSystemTaskNotificationListener[]{adapter}; } return cancel(ls); }