@Test
public void restartInstance() {

    DefaultDockerCloudClient client = createClient();
    DockerImage dockerImage = waitForImage(client);
    DockerInstance instance = client.startNewInstance(dockerImage, userData);
    waitForInstanceStatus(instance, InstanceStatus.RUNNING);
    client.restartInstance(instance);
    waitUntil(() -> {
        assertThat(instance.getErrorInfo()).isNull();
        assertThat(instance.getStatus()).isIn(InstanceStatus.UNKNOWN, InstanceStatus.RESTARTING,
                InstanceStatus.RUNNING);
        return instance.getStatus() == InstanceStatus.RUNNING;
    });
}