if (servers.get(i).getStatus().equals(status)) continue;  times++; try { Thread.sleep(100); } catch (InterruptedException e) { if (times > SERVER_COUNT * 10) {
int times= 0; do { String cmp= servers.get(i).getStatus(); System.out.println("Listener #" + i + " = " + cmp);  if (cmp.equals(status)) break;  if (times++ > 10) { System.out.println("Listener #" + i + " timeout after " + times + " tries"); fail("Timeout"); }  try { Thread.sleep(100); } catch (InterruptedException e) {
    protected static void waitFor(String status) {        int times= 0;        for (int i= 0; i < SERVER_COUNT; i++) {            if (servers.get(i).getStatus().equals(status)) continue;                        times++;            try {                Thread.sleep(100);            } catch (InterruptedException e) {                 if (times > SERVER_COUNT * 10) {                    fail(e.getMessage());                }            }        }        System.out.println("All listeners now in " + status);    }