public static void waitForInstancesToBeStopped(AmazonEC2AsyncClient client,VerificationHost host,List<String> instanceIdsToStop) throws Throwable {
  ArrayList<Boolean> stopFlags=new ArrayList<>(instanceIdsToStop.size());
  for (int i=0; i < instanceIdsToStop.size(); i++) {
    stopFlags.add(i,Boolean.FALSE);
  }
  host.waitFor("Error waiting for EC2 client stop instances in test ",null);
}

public static void waitForInstancesToBeStopped ( AmazonEC2AsyncClient client , VerificationHost host , List < String > instanceIdsToStop ) throws Throwable { ArrayList < Boolean > stopFlags = new ArrayList < > ( instanceIdsToStop . size ( ) ) ; for ( int i = 0 ; i < instanceIdsToStop . size ( ) ; i ++ ) { stopFlags . add ( i , Boolean . FALSE ) ; } host . waitFor ( "Error waiting for EC2 client stop instances in test " , null ) ; }
wait for the instances have their status set to stopped .
