private void unassignUnsentCalls(Predicate<Node> shouldUnassign) {
            for (Iterator<Map.Entry<Node, List<Call>>> iter = callsToSend.entrySet().iterator(); iter.hasNext(); ) {
                Map.Entry<Node, List<Call>> entry = iter.next();
                Node node = entry.getKey();
                List<Call> awaitingCalls = entry.getValue();

                if (awaitingCalls.isEmpty()) {
                    iter.remove();
                } else if (shouldUnassign.test(node)) {
                    nodeReadyDeadlines.remove(node);
                    transitionToPendingAndClearList(awaitingCalls);
                    iter.remove();
                }
            }
        }
Unassign calls that have not yet been sent based on some predicate. For example, this
is used to reassign the calls that have been assigned to a disconnected node.

@param shouldUnassign Condition for reassignment. If the predicate is true, then the calls will
                      be put back in the pendingCalls collection and they will be reassigned
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java