class RunOnMultipleDevicesAction extends AnAction {

  @Override
  public void update(@NotNull AnActionEvent event) {
    Project project = event.getProject();
    Presentation presentation = event.getPresentation();

    if (project == null) {
      presentation.setEnabled(false);
      return;
    }

    RunnerAndConfigurationSettings settings = myGetSelectedConfiguration.apply(project);

    if (settings == null) {
      presentation.setEnabled(false);
      return;
    }

    if (!isSupportedRunConfigurationType(settings.getType())) {
      presentation.setEnabled(false);
      return;
    }

    if (myGetDevices.apply(project).isEmpty()) {
      presentation.setEnabled(false);
      return;
    }

    presentation.setEnabled(true);
  }

    RunOnMultipleDevicesAction();
  @VisibleForTesting  RunOnMultipleDevicesAction(@NotNull Function<Project, RunnerAndConfigurationSettings> getSelectedConfiguration,
                             @NotNull Function<Project, Collection<Device>> getDevices);

}