public static int calculateHorsesFinished(List<Horse> horses) throws InterruptedException { int finishedCount = 0; //write your code here while(true){ if(isFinished()){ finishedCount++;} else if(!isFinished()){ System.out.println("Waiting for " + getName()); Thread.join(); } } return finishedCount; }