class InstanceFailureStepDefinitions implements EC2StepFunctions {

    @When("^\"([^\"]*)\" disk full with (\\d+) GB on (\\d+) instance$")
    public InstanceFailureStepDefinitions diskFullOnInstance(String volumeType, int size, int instanceCount) throws Throwable {
        List<EC2InstanceTO> instances = executionStateCache.getInstances();
        if (instances == null || instances.isEmpty()) {
            throw new RuntimeException("No Instances are available");
        }

        if (instanceCount > instances.size()) {
            instanceCount = instances.size();
        }


        IntStream.range(0, instanceCount)
                .parallel()
                .forEach(
                        i ->
                        {

                            diskFullHelper(volumeType, size, instances.get(i).getInstanceId(), instances.get(i).getPrivateIpAddress());
                            executionStateCache.setHealProcess(true);
                            executionStateCache.addUnHealthyInstance(instances.get(i));
                        });

        return this;
    }

    public  InstanceFailureStepDefinitions();

}