int handleTimeouts(Collection<Call> calls, String msg) {
            int numTimedOut = 0;
            for (Iterator<Call> iter = calls.iterator(); iter.hasNext(); ) {
                Call call = iter.next();
                int remainingMs = calcTimeoutMsRemainingAsInt(now, call.deadlineMs);
                if (remainingMs < 0) {
                    call.fail(now, new TimeoutException(msg + " Call: " + call.callName));
                    iter.remove();
                    numTimedOut++;
                } else {
                    nextTimeoutMs = Math.min(nextTimeoutMs, remainingMs);
                }
            }
            return numTimedOut;
        }
Check for calls which have timed out.
Timed out calls will be removed and failed.
The remaining milliseconds until the next timeout will be updated.

@param calls         The collection of calls.

@return              The number of calls which were timed out.
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java