StartSynchronizer { public synchronized void setStartThread() throws InternalInfrastructureException { if (startThread != null) { throw new InternalInfrastructureException("Runtime is already started"); } startThread = Thread.currentThread(); } @Inject  StartSynchronizer(
      EventService eventService,
      @Named("che.infra.kubernetes.workspace_start_timeout_min") int workspaceStartTimeoutMin,
      @Assisted RuntimeIdentity runtimeId); synchronized void start(); synchronized void setStartThread(); synchronized void complete(); synchronized void completeExceptionally(Exception ex); void checkFailure(); CompletableFuture<Void> getStartFailure(); synchronized boolean interrupt(); boolean awaitInterruption(long timeout, TimeUnit unit); boolean isCompleted(); InfrastructureException getStartFailureNow(); long getStartTimeoutMillis();  }
@Test( expectedExceptions = InternalInfrastructureException.class, expectedExceptionsMessageRegExp = "Runtime is already started") public void shouldNotSetStartThreadIfItIsAlreadySet() throws Exception { startSynchronizer.setStartThread(); startSynchronizer.setStartThread(); }