class DeployTargetContext implements JDOMExternalizable {

  @NotNull
  public DeployTargetProvider getCurrentDeployTargetProvider() {
    Object mode = getTargetSelectionMode().name();

    Optional<DeployTargetProvider> optionalProvider = myDeployTargetProviders.stream()
      .filter(provider -> provider.getId().equals(mode))
      .findFirst();

    return optionalProvider.orElseThrow(AssertionError::new);
  }

  public  DeployTargetContext();
  @VisibleForTesting  DeployTargetContext(@NotNull Collection<DeployTargetProvider> deployTargetProviders);

}