public static boolean isUnanimousCandidate(
        final ClusterMember[] clusterMembers, final ClusterMember candidate, final int gracefulClosedLeaderId)
    {
        int possibleVotes = 0;

        for (final ClusterMember member : clusterMembers)
        {
            if (member.id == gracefulClosedLeaderId)
            {
                continue;
            }

            if (NULL_POSITION == member.logPosition || compareLog(candidate, member) < 0)
            {
                return false;
            }

            possibleVotes++;
        }

        return possibleVotes >= ClusterMember.quorumThreshold(clusterMembers.length);
    }
@Test
    void isUnanimousCandidateReturnFalseIfLeaderClosesGracefully()
    {
        final int gracefulClosedLeaderId = 1;
        final ClusterMember candidate = newMember(2, 2, 100);
        final ClusterMember[] members = new ClusterMember[]
        {
            newMember(1, 2, 100),
            newMember(2, 2, 100),
        };

        assertFalse(isUnanimousCandidate(members, candidate, gracefulClosedLeaderId));
    }