code: public int getZoneNAry(int zoneId, int nodeId, byte[] key) {
          if(cluster.getNodeById(nodeId).getZoneId() != zoneId) {
              throw new VoldemortException("Node " + nodeId + " is not in zone " + zoneId
                                           + "! The node is in zone "
                                           + cluster.getNodeById(nodeId).getZoneId());
          }
  
          List<Node> replicatingNodes = this.routingStrategy.routeRequest(key);
          int zoneNAry = -1;
          for(Node node: replicatingNodes) {
              // bump up the replica number once you encounter a node in the given
              // zone
              if(node.getZoneId() == zoneId) {
                  zoneNAry++;
              }
              // we are done when we find the given node
              if(node.getId() == nodeId) {
                  return zoneNAry;
              }
          }
          if(zoneNAry > -1) {
              throw new VoldemortException("Node " + nodeId + " not a replica for the key "
                                           + ByteUtils.toHexString(key) + " in given zone " + zoneId);
          } else {
              throw new VoldemortException("Could not find any replicas for the key "
                                           + ByteUtils.toHexString(key) + " in given zone " + zoneId);
          }
      }
docs: TODO: add unit test.