docs: public static Key.Builder makeKey(Object... elements) {
      Key.Builder key = Key.newBuilder();
      PartitionId partitionId = null;
      for (int pathIndex = 0; pathIndex < elements.length; pathIndex += 2) {
        PathElement.Builder pathElement = PathElement.newBuilder();
        Object element =  elements[pathIndex];
        if (element instanceof Key) {
          Key subKey = (Key) element;
          if (partitionId == null) {
            partitionId = subKey.getPartitionId();
          } else if (!partitionId.equals(subKey.getPartitionId())) {
            throw new IllegalArgumentException("Partition IDs did not match, found: "
                + partitionId + " and " + subKey.getPartitionId());
          }
          key.addAllPath(((Key) element).getPathList());
          // We increment by 2, but since we got a Key argument we're only consuming 1 element in this
          // iteration of the loop. Decrement the index so that when we jump by 2 we end up in the
          // right spot.
          pathIndex--;
        } else {
          String kind;
          try {
            kind = (String) element;
          } catch (ClassCastException e) {
            throw new IllegalArgumentException("Expected string or Key, got: " + element.getClass());
          }
          pathElement.setKind(kind);
          if (pathIndex + 1 < elements.length) {
            Object value = elements[pathIndex + 1];
            if (value instanceof String) {
              pathElement.setName((String) value);
            } else if (value instanceof Long) {
              pathElement.setId((Long) value);
            } else if (value instanceof Integer) {
              pathElement.setId((Integer) value);
            } else if (value instanceof Short) {
              pathElement.setId((Short) value);
            } else {
              throw new IllegalArgumentException(
                  "Expected string or integer, got: " + value.getClass());
            }
          }
          key.addPath(pathElement);
        }
      }
      if (partitionId != null && !partitionId.equals(PartitionId.getDefaultInstance())) {
        key.setPartitionId(partitionId);
      }
      return key;
    }