code: private boolean determineIfEligibleAsLeader(Collection<Integer> partitions, Set<Integer> partitionGroupPeers,
              AbstractTopology topology) {
          if (partitions.contains(Integer.valueOf(0))) {
              return true;
          }
          for (Integer host : topology.getHostIdList(0)) {
              if (partitionGroupPeers.contains(host)) {
                  return true;
              }
          }
          return false;
      }
docs: This host can be a leader if partition 0 is on it or it is in the same partition group as a node which has
  partition 0. This is because the partition group with partition 0 can never be removed by elastic remove.
  
  @param partitions          {@link List} of partitions on this host
  @param partitionGroupPeers {@link List} of hostIds which are in the same partition group as this host
  @param topology            {@link AbstractTopology} for the cluster
  @return {@code true} if this host is eligible as a leader for non partition services