HostPort hostPort2 = new HostPort("127.0.0.1", 22222);
final FailoverWatcher failoverWatcher2 = createFailoverWatcher(hostPort2);
Thread thread2 = new Thread() {
@Override
public void run() {
failoverWatcher2.blockUntilActive();
}
};
thread2.start();
Thread.sleep(500); // wait for backup master to init