class JobDetailFormatter {

    protected static long getSimulationTime(JobInstance proposedJobInstance, Workload workload, JobValidator validator) {
        long ret = proposedJobInstance.getSimulationTime();
        if (TerminationPolicy.script == proposedJobInstance.getTerminationPolicy()) {
            ret = 0;
            for (TestPlan plan : workload.getTestPlans()) {
                ret = Math.max(ret, validator.getExpectedTime(plan.getName()));
            }
        }
        return ret;
    }

}