class InstanceFailureStepDefinitions implements EC2StepFunctions {

    @When("^terminate process  \"([^\"]*)\" on (\\d+) instance$")
    public InstanceFailureStepDefinitions terminateProcessOnHealthyInstances(String processName, int numHosts) {
        List<EC2InstanceTO> instances = executionStateCache.getInstances();

        if (instances == null || instances.isEmpty()) {
            throw new RuntimeException("No Instances are available");
        }

        executionStateCache.addProcessName(processName);

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

        terminateProcess(processName, numHosts, instances);

        return this;
    }

    public  InstanceFailureStepDefinitions();

}