do {
Iterable<ServiceEndPoint> allEndPoints = getAllEndPoints();
if (Iterables.isEmpty(allEndPoints)) {
throw (lastException == null)
? new NoAvailableHostsException()
: new NoAvailableHostsException(lastException);
}
Iterable<ServiceEndPoint> validEndPoints = getValidEndPoints(allEndPoints);
if (Iterables.isEmpty(validEndPoints)) {
throw (lastException == null)