+ if (lastResponse instanceof Throwable) {
+ throw (AssertionError)new AssertionError(
+ String.format("Unexpected error occurred from FindLeader for shard %s", shard.path()))
+ .initCause((Throwable)lastResponse);
+ }
+
+ Assert.fail(String.format("Unexpected leader %s found for shard %s", lastResponse, shard.path()));